summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-10-16 20:19:55 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-10-16 20:19:55 +0200
commit7b3a68036aa29d239b85b05df5fe6f35a68f41d2 (patch)
tree773b31c1def40e2a23f1b0bcdf68d59c10773847
parentf948eeabc92e5426027ffdc68d239153f8cf71d3 (diff)
downloadrpg-7b3a68036aa29d239b85b05df5fe6f35a68f41d2.tar.gz
rpg-7b3a68036aa29d239b85b05df5fe6f35a68f41d2.tar.bz2
Avoid editing sections of outdated pages FS#1513
darcs-hash:20081016181955-7ad00-5745635416542fd04dbdf67cbf043bf446e995bc.gz
-rw-r--r--inc/common.php7
-rw-r--r--inc/lang/en/lang.php1
2 files changed, 8 insertions, 0 deletions
diff --git a/inc/common.php b/inc/common.php
index 73e153947..d58eacb7a 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -99,8 +99,10 @@ function formSecurityToken($print=true){
function pageinfo(){
global $ID;
global $REV;
+ global $RANGE;
global $USERINFO;
global $conf;
+ global $lang;
// include ID & REV not redundant, as some parts of DokuWiki may temporarily change $ID, e.g. p_wiki_xhtml
// FIXME ... perhaps it would be better to ensure the temporary changes weren't necessary
@@ -143,6 +145,11 @@ function pageinfo(){
//check if current revision was meant
if($info['exists'] && (@filemtime($info['filepath'])==$REV)){
$REV = '';
+ }elseif($RANGE){
+ //section editing does not work with old revisions!
+ $REV = '';
+ $RANGE = '';
+ msg($lang['nosecedit'],0);
}else{
//really use old revision
$info['filepath'] = fullpath(wikiFN($ID,$REV));
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 8ee81ed18..26f6bcd45 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -64,6 +64,7 @@ $lang['profile'] = 'User Profile';
$lang['badlogin'] = 'Sorry, username or password was wrong.';
$lang['minoredit'] = 'Minor Changes';
$lang['draftdate'] = 'Draft autosaved on'; // full dformat date will be added
+$lang['nosecedit'] = 'The page was changed in the meantime, section info was out of date loaded full page instead.';
$lang['regmissing'] = 'Sorry, you must fill in all fields.';
$lang['reguexists'] = 'Sorry, a user with this login already exists.';