diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-12-09 17:26:28 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-12-09 17:26:28 +0100 |
commit | 8702de7f7e170bddfdb622c393c3cac3446fd1c5 (patch) | |
tree | c7269ea61f5d4230a6f916dbabee4ce412e0a9fb /doku.php | |
parent | 1cc82e5c76ae7fcd646e448404afdc0fd458bf55 (diff) | |
parent | 9a0ca2cfd8ac42895af3be2efbd2cab7e6d33578 (diff) | |
download | rpg-8702de7f7e170bddfdb622c393c3cac3446fd1c5.tar.gz rpg-8702de7f7e170bddfdb622c393c3cac3446fd1c5.tar.bz2 |
Merge remote-tracking branch 'origin/master' into scrutinizerissues
Conflicts:
inc/media.php
inc/plugin.php
inc/template.php
lib/plugins/authplain/_test/escaping.test.php
lib/plugins/syntax.php
Diffstat (limited to 'doku.php')
-rw-r--r-- | doku.php | 39 |
1 files changed, 37 insertions, 2 deletions
@@ -9,7 +9,7 @@ */ // update message version -$updateVersion = 45; +$updateVersion = 47; // 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 |