summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2006-09-11 03:47:38 +0200
committerBen Coburn <btcoburn@silicodon.net>2006-09-11 03:47:38 +0200
commite45b34cdb82ad8fad44374c0d8f1df64952dc3a7 (patch)
tree3af5bc94e00bda01f14a5e976161890acb2eb632 /inc/common.php
parentd818621633e2c687264682f0504869858f9c780d (diff)
downloadrpg-e45b34cdb82ad8fad44374c0d8f1df64952dc3a7.tar.gz
rpg-e45b34cdb82ad8fad44374c0d8f1df64952dc3a7.tar.bz2
changelog redesign update
- Improves handling of deleted revisions. - Import plugin disables after import. - Check act reports if plugin is still enabled after the import. - Import correctly handles summaries without the minor prefix. - Newlines and tabs are now striped out of type, sum, and extra in the changelog. darcs-hash:20060911014738-05dcb-2f6c9fdffb6346f7d3190610a72b290090b28097.gz
Diffstat (limited to 'inc/common.php')
-rw-r--r--inc/common.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/inc/common.php b/inc/common.php
index ca60b8edc..7c20c0b8f 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -737,14 +737,15 @@ function addLogEntry($date, $id, $type='E', $summary='', $extra=''){
$remote = $_SERVER['REMOTE_ADDR'];
$user = $_SERVER['REMOTE_USER'];
+ $strip = array("\t", "\n");
$logline = array(
'date' => $date,
'ip' => $remote,
- 'type' => $type,
+ 'type' => str_replace($strip, '', $type),
'id' => $id,
'user' => $user,
- 'sum' => $summary,
- 'extra' => $extra
+ 'sum' => str_replace($strip, '', $summary),
+ 'extra' => str_replace($strip, '', $extra)
);
// update metadata
@@ -1087,8 +1088,12 @@ function saveWikiText($id,$text,$summary,$minor=false){
$wasRemoved = empty($text);
$wasCreated = !@file_exists($file);
$wasReverted = ($REV==true);
+ $newRev = false;
if ($wasRemoved){
+ // pre-save deleted revision
+ @touch($file);
+ $newRev = saveOldRevision($id);
// remove empty file
@unlink($file);
// remove old meta info...
@@ -1107,6 +1112,7 @@ function saveWikiText($id,$text,$summary,$minor=false){
}else{
// save file (namespace dir is created in io_writeWikiPage)
io_writeWikiPage($file, $text, $id);
+ $newRev = @filemtime($file);
$del = false;
}
@@ -1121,7 +1127,7 @@ function saveWikiText($id,$text,$summary,$minor=false){
else if ($wasRemoved) { $type = 'D'; }
else if ($minor && $conf['useacl'] && $_SERVER['REMOTE_USER']) { $type = 'e'; } //minor edits only for logged in users
- addLogEntry(@filemtime($file), $id, $type, $summary, $extra);
+ addLogEntry($newRev, $id, $type, $summary, $extra);
// send notify mails
notify($id,'admin',$old,$summary,$minor);
notify($id,'subscribers',$old,$summary,$minor);
@@ -1366,6 +1372,9 @@ function check(){
msg('Importing old changelog now.', 0);
} else if (@file_exists($conf['changelog'].'_import_ok')) {
msg('Old changelog imported.', 1);
+ if (!plugin_isdisabled('importoldchangelog')) {
+ msg('Importoldchangelog plugin not disabled after import.', -1);
+ }
}
if(is_writable($conf['datadir'])){