Skip to content
Snippets Groups Projects
Commit 443d207b authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fixed PHP4 incompatibility in sectionID() FS#1553

darcs-hash:20081226161244-7ad00-8c843ea6a06a0d36fc322d109497239ab6ea229c.gz
parent 6df2a685
No related branches found
No related tags found
No related merge requests found
......@@ -340,7 +340,8 @@ function act_redirect($id,$preact){
//get section name when coming from section edit
if($PRE && preg_match('/^\s*==+([^=\n]+)/',$TEXT,$match)){
$title = sectionID($match[0]);
$check = false;
$title = sectionID($match[0],$check);
}
$opts = array(
......
......@@ -195,7 +195,7 @@ function noNSorNS($id) {
* @param array $check List of existing IDs
* @author Andreas Gohr <andi@splitbrain.org>
*/
function sectionID($title,&$check=null) {
function sectionID($title,&$check) {
$title = str_replace(':','',cleanID($title));
$new = ltrim($title,'0123456789._-');
if(empty($new)){
......@@ -204,7 +204,7 @@ function sectionID($title,&$check=null) {
$title = $new;
}
if(!is_null($check) && is_array($check)){
if(is_array($check)){
// make sure tiles are unique
$num = '';
while(in_array($title.$num,$check)){
......
......@@ -1006,7 +1006,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
if($create){
return sectionID($title,$this->headers);
}else{
return sectionID($title);
$check = false;
return sectionID($title,$check);
}
}
......
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