summaryrefslogtreecommitdiff
path: root/doku.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-09-29 20:17:39 +0200
committerAndreas Gohr <andi@splitbrain.org>2014-09-29 20:17:39 +0200
commit6c1ae996157551dcf5bb4e7e8922677bb3d3d358 (patch)
treeb3a4162367176a4e2ebadbd6ab31753c1b042be0 /doku.php
parent35f3340eb3b989194a496861abfb5b3d3c9a630d (diff)
parent57271d078b9c433bec79d75cb44dadcafeae07df (diff)
downloadrpg-6c1ae996157551dcf5bb4e7e8922677bb3d3d358.tar.gz
rpg-6c1ae996157551dcf5bb4e7e8922677bb3d3d358.tar.bz2
Merge branch 'master' into stable
* master: (214 commits) release preparations postgresql auth plugin: correct function name parse AT parameter: first strtotime then timestamp remove config option move more strings to lang.php move strings to lang.php add placeholders for create page text phpdocs parserutils improve some scrutinizer issues visibility plugin methods use config cascade for loading of localizations reformatting config cascade add lang files to cascading work around missing gzopen on certain systems #865 translation update fix scrutinizer issues fixed typos in docblock comments do not allow empty passwords clean user credentials from control chars added filter method to INPUT class translation update ...
Diffstat (limited to 'doku.php')
-rw-r--r--doku.php39
1 files changed, 37 insertions, 2 deletions
diff --git a/doku.php b/doku.php
index 4bf904af9..261ceaec2 100644
--- a/doku.php
+++ b/doku.php
@@ -9,7 +9,7 @@
*/
// update message version
-$updateVersion = 44.1;
+$updateVersion = 46;
// xdebug_start_profiling();
@@ -34,6 +34,7 @@ $QUERY = trim($INPUT->str('id'));
$ID = getID();
$REV = $INPUT->int('rev');
+$DATE_AT = $INPUT->str('at');
$IDX = $INPUT->str('idx');
$DATE = $INPUT->int('date');
$RANGE = $INPUT->str('range');
@@ -47,7 +48,41 @@ $PRE = cleanText(substr($INPUT->post->str('prefix'), 0, -1));
$SUF = cleanText($INPUT->post->str('suffix'));
$SUM = $INPUT->post->str('summary');
-//make info about the selected page available
+
+//parse DATE_AT
+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;
+ }
+ }
+}
+
+//check for existing $REV related to $DATE_AT
+if($DATE_AT) {
+ $pagelog = new PageChangeLog($ID);
+ $rev_t = $pagelog->getLastRevisionAt($DATE_AT);
+ 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);
+ 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;
+ }
+}
+
+//make infos about the selected page available
$INFO = pageinfo();
//export minimal info to JS, plugins can add more