Replace direct calls to strftime with dformat calls

This is in preparation for fixing #3573
This commit is contained in:
Andreas Gohr 2022-04-28 09:58:06 +02:00
parent 36a1a8807f
commit 10f359ad04
3 changed files with 11 additions and 7 deletions

View File

@ -79,10 +79,14 @@ if($DATE_AT) {
$DATE_AT = null;
} else if ($rev_t === false) { //page did not exist
$rev_n = $pagelog->getRelativeRevision($DATE_AT,+1);
msg(sprintf($lang['page_nonexist_rev'],
strftime($conf['dformat'],$DATE_AT),
wl($ID, array('rev' => $rev_n)),
strftime($conf['dformat'],$rev_n)));
msg(
sprintf(
$lang['page_nonexist_rev'],
dformat($DATE_AT),
wl($ID, array('rev' => $rev_n)),
dformat($rev_n)
)
);
$REV = $DATE_AT; //will result in a page not exists message
} else {
$REV = $rev_t;

View File

@ -637,8 +637,8 @@ abstract class ChangeLog
} else {
// $fileRev is older than $lastRev, that is erroneous/incorrect occurence.
$msg = "Warning: current file modification time is older than last revision date";
$details = 'File revision: '.$fileRev.' '.strftime("%Y-%m-%d %H:%M:%S", $fileRev)."\n"
.'Last revision: '.$lastRev.' '.strftime("%Y-%m-%d %H:%M:%S", $lastRev);
$details = 'File revision: '.$fileRev.' '.dformat($fileRev, "%Y-%m-%d %H:%M:%S")."\n"
.'Last revision: '.$lastRev.' '.dformat($lastRev, "%Y-%m-%d %H:%M:%S");
Logger::error($msg, $details, $this->getFilename());
$timestamp = false;
$sum = $lang['external_edit'].' ('.$lang['unknowndate'].')';

View File

@ -1164,7 +1164,7 @@ function parsePageTemplate(&$data) {
$tpl = preg_replace_callback(
'/%./',
function ($m) {
return strftime($m[0]);
return dformat(null, $m[0]);
},
$tpl
);