[pmwiki-users] deleting pages

Joachim Durchholz jo at durchholz.org
Fri Feb 17 03:36:18 CST 2006


Susan schrieb:
> As I understand it, deleting a page removes the entire history, and to get it
> back you have to go to the backups, the copies of the files that the techie
> keeps in case of viruses or server crashes.

PmWiki doesn't delete the file, it renames it. PmWiki doesn't look into 
such renamed files, so for the visitor, the page is indeed gone.
However, you don't need the techie to restore the page, just rename the 
file back into a PmWiki-style file name.

> Replacing the contents with something else keeps the history intact; you just
> have to go to the Diffs page and ask to restore.
> 
> I rather like the idea of a customizable word for deleting the pages.

Place this in your config.php:
   $DeleteKeyPattern = "^\\s*delete\\s*$";
Replace 'delete' with something more to your taste :-)

The thing is a regular expression. It's components mean:
   ^ - Start the match at the start of the text.
       (Otherwise, a " delete " anywhere in the text would match.)
   \\s - A space (space, tab, whatever).
   \\s* - A sequence of spaces (zero spaces will match, too).
   delete - the literal string "delete".
   $ - The match must extend to the end of the text.
IOW the above regex says: "Page must consist of just the word 'delete', 
possible with whitespace before and after it."

> That way, what works on your site won't work on mine, and vice versa,
> keeping the risk of vandalism down.

That would keep automated vandalism down (say, a script running around 
the net and issuing "delete" commands to wiki pages). PmWiki isn't 
widespread enough for that though.
Most vandalism is due to scripts writing advertisements into wiki pages.

Manual vandalism isn't kept down by that. Anybody trying to vandalize 
your site will find out how to delete pages. Vandalizing by writing 
nonsense into a page is usually easier for manual vandals, too... that's 
probably why nobody bothered about deletion vandalism yet.

Regards,
Jo




More information about the pmwiki-users mailing list