diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php index f92e81e8c3e7dd322722045d396d23e71738eea3..bdc9739d1844a0c1e9b996717a28bcf84d9e12e7 100644 --- a/conf/dokuwiki.php +++ b/conf/dokuwiki.php @@ -155,7 +155,6 @@ $conf['broken_iua'] = 0; //Platform with broken ignore_user_abor $conf['xsendfile'] = 0; //Use X-Sendfile (1 = lighttpd, 2 = standard) $conf['renderer_xhtml'] = 'xhtml'; //renderer to use for main page generation $conf['readdircache'] = 0; //time cache in second for the readdir operation, 0 to deactivate. -$conf['date_at_format'] = 'Y-m-d-H:i:s'; /* Network Settings */ $conf['dnslookups'] = 1; //disable to disallow IP to hostname lookups diff --git a/doku.php b/doku.php index 6673d2d66aa1de5286091f246148ba681c6b39d9..f4309d122698f339f84321ab185f346c9334094c 100644 --- a/doku.php +++ b/doku.php @@ -50,13 +50,16 @@ $SUM = $INPUT->post->str('summary'); //parse DATE_AT -if($DATE_AT && $conf['date_at_format']) { - $date_o = DateTime::createFromFormat($conf['date_at_format'],$DATE_AT); - if(!$date_o) { - msg(sprintf($lang['unable_to_parse_date'], $DATE_AT,$conf['date_at_format'])); - $DATE_AT = null; - } else { - $DATE_AT = $date_o->getTimestamp(); +if($DATE_AT) { + $date_parse = strtotime($DATE_AT); + if($date_parse) { + $DATE_AT = $date_parse; + } else { // check for UNIX Timestamp + $date_parse = @date('Ymd',$DATE_AT); + if(!$date_parse || $date_parse === '19700101') { + msg(sprintf($lang['unable_to_parse_date'], $DATE_AT)); + $DATE_AT = null; + } } } @@ -64,16 +67,16 @@ if($DATE_AT && $conf['date_at_format']) { if($DATE_AT) { $pagelog = new PageChangeLog($ID); $rev_t = $pagelog->getLastRevisionAt($DATE_AT); - if($rev_t === '') { - $REV = ''; - } else if ($rev_t === false) { + if($rev_t === '') { //current revision + $REV = null; + $DATE_AT = null; + } else if ($rev_t === false) { //page did not exist $rev_n = $pagelog->getRelativeRevision($DATE_AT,+1); - if($conf['date_at_format']) { - msg(sprintf($lang['page_nonexist_rev'], date($conf['date_at_format'],$DATE_AT),date($conf['date_at_format'],$rev_n))); - } else { - msg(sprintf($lang['page_nonexist_rev'], $DATE_AT,$rev_n)); - } - $REV = $DATE_AT; + msg(sprintf($lang['page_nonexist_rev'], + strftime($conf['dformat'],$DATE_AT), + wl($ID, array('rev' => $rev_n)), + strftime($conf['dformat'],$rev_n))); + $REV = $DATE_AT; //will result in a page not exists message } else { $REV = $rev_t; } diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 9215a3f1d4f052839df3c91c34585e70e1e9b7ad..b8d5b2280ae27362fdc46b627bd333502334cfdc 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -367,6 +367,6 @@ $lang['currentns'] = 'Current namespace'; $lang['searchresult'] = 'Search Result'; $lang['plainhtml'] = 'Plain HTML'; $lang['wikimarkup'] = 'Wiki Markup'; -$lang['page_nonexist_rev'] = 'Page did not exist at %s. It was subsequently created at %s.'; -$lang['unable_to_parse_date'] = 'Unable to parse at parameter "%s" with format "%s".'; +$lang['page_nonexist_rev'] = 'Page did not exist at %s. It was subsequently created at <a href="%s">%s</a>.'; +$lang['unable_to_parse_date'] = 'Unable to parse at parameter "%s".'; //Setup VIM: ex: et ts=2 : diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php index 3fc9c292024afc7612116100625918c3dff6b033..5e5218aff9d67c4cd0487cbf3c98cc45959bcc98 100644 --- a/lib/plugins/config/lang/en/lang.php +++ b/lib/plugins/config/lang/en/lang.php @@ -172,7 +172,6 @@ $lang['xsendfile'] = 'Use the X-Sendfile header to let the webserver deliver s $lang['renderer_xhtml'] = 'Renderer to use for main (xhtml) wiki output'; $lang['renderer__core'] = '%s (dokuwiki core)'; $lang['renderer__plugin'] = '%s (plugin)'; -$lang['date_at_format'] = 'Date at format (see PHP\'s <a href="http://www.php.net/manual/datetime.formats.php">datetime.formats</a> information). If empty UNIX timestamp format will be used.'; /* Network Options */ $lang['dnslookups'] = 'DokuWiki will lookup hostnames for remote IP addresses of users editing pages. If you have a slow or non working DNS server or don\'t want this feature, disable this option'; diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php index 5cd09a8cbc58ac0262b11407b7e089bcdcb3910a..aaa32cd70b9b15ca2210817d1548a93cc59af00e 100644 --- a/lib/plugins/config/settings/config.metadata.php +++ b/lib/plugins/config/settings/config.metadata.php @@ -209,7 +209,6 @@ $meta['broken_iua'] = array('onoff'); $meta['xsendfile'] = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning'); $meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning'); $meta['readdircache'] = array('numeric'); -$meta['date_at_format'] = array('string'); $meta['_network'] = array('fieldset'); $meta['dnslookups'] = array('onoff');