1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Forum update fixes (duplicate SEF & logging)

This commit is contained in:
Moc
2021-03-22 20:31:07 +01:00
parent 79ded794b1
commit cdc61c90ee

View File

@@ -474,7 +474,8 @@ function step5()
$counts = array( $counts = array(
'parents' => 0, 'parents' => 0,
'forums' => 0, 'forums' => 0,
'subs' => 0 'subs' => 0,
'sefs' => 1, // start on 1, so that a duplicate sef gets "-2" as suffix
); );
//XXX Typo on 'parents' ? //XXX Typo on 'parents' ?
@@ -505,7 +506,8 @@ function step5()
if(isset($sefs[$forum_sef])) if(isset($sefs[$forum_sef]))
{ {
$forum_sef .= "-2"; $counts['sefs']++;
$forum_sef .= "-".$counts['sefs']; // adds "-2", "-3", etc.. when duplicate sef is found.
} }
$tmp['forum_sef'] = $forum_sef; $tmp['forum_sef'] = $forum_sef;
@@ -1328,7 +1330,7 @@ class forumUpgrade
// echo "logf = ".$this->logf."<br />"; // echo "logf = ".$this->logf."<br />";
$txt = sprintf("%s - %s\n", date('m/d/Y H:i:s'), $msg); $txt = sprintf("%s - %s\n", date('m/d/Y H:i:s'), $msg);
// echo $txt."<br />"; // echo $txt."<br />";
$flag = ($append ? FILE_APPEND : ''); $flag = ($append ? FILE_APPEND : 0);
file_put_contents($this->logf, $txt, $flag); file_put_contents($this->logf, $txt, $flag);
} }