Skip to content
Snippets Groups Projects
Commit 37c1acbd authored by Adrian Lang's avatar Adrian Lang
Browse files

Correctly handle non-default sepchars in page templates (FS#2057)

parent 987193f7
No related branches found
No related tags found
No related merge requests found
<?php
require_once DOKU_INC.'inc/common.php';
class common_pagetemplate_test extends UnitTestCase {
function test_none(){
global $conf;
$conf['sepchar'] = '-';
$data = array(
'id' => 'page-id-long',
'tpl' => '"@PAGE@" "@!PAGE@" "@!!PAGE@" "@!PAGE!@"',
);
$old = error_reporting(E_ALL & ~E_NOTICE);
$this->assertEqual(parsePageTemplate($data), '"page id long" "Page id long" "Page Id Long" "PAGE ID LONG"');
error_reporting($old);
}
}
//Setup VIM: ex: et ts=4 enc=utf-8 :
......@@ -843,7 +843,7 @@ function parsePageTemplate(&$data) {
// replace placeholders
$file = noNS($id);
$page = strtr($file,'_',' ');
$page = strtr($file, $conf['sepchar'], ' ');
$tpl = str_replace(array(
'@ID@',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment