summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/dokuwiki.php1
-rw-r--r--doku.php35
-rw-r--r--inc/lang/en/lang.php4
-rw-r--r--lib/plugins/config/lang/en/lang.php1
-rw-r--r--lib/plugins/config/settings/config.metadata.php1
5 files changed, 21 insertions, 21 deletions
diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php
index f92e81e8c..bdc9739d1 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 6673d2d66..f4309d122 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 9215a3f1d..b8d5b2280 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 3fc9c2920..5e5218aff 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 5cd09a8cb..aaa32cd70 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');