[pmwiki-users] Don't allow saving guest post for 0 modification

Dominique Faure dominique.faure at gmail.com
Wed Dec 16 16:59:02 CST 2015


Hi,

A solution could be to handle this in the same way it is already done with
author requirement: Looking at scripts/author.php, you'll could easily see
that the form post is interrupted by setting the $EnablePost variable to 0;

Have a try with the following code:

array_unshift($EditFunctions, "DeltaPageContent");
function DeltaPagecontent($pagename,&$page,&$new) {
  global $EnablePost, $ModifiedPageContentRequiredFmt;
  if (!$EnablePost) return;

  if ($new['text'] != $page['text']) {
    SDV($ModifiedPageContentRequiredFmt, "<h3 class='wikimessage'>$[The
page hasn't been modified.]</h3>");
    $MessagesFmt[] = $ModifiedPageContentRequiredFmt;
    $EnablePost = 0;
  }
}

Regards,
Dominique


On Wed, Dec 16, 2015 at 2:57 PM, ABClf <languefrancaise at gmail.com> wrote:

> Hello,
>
> I'm facing a bit of spam on my wiki.
> For my defense, I use blocklist and Petko's Spamfilters cookbook.
>
> Problem is I have spammer posting unmodified pages (original text
> remains unaltered, yet spammer does appear in the page's history as a
> contributor and therefore the page is said to have been newly
> revised).
>
> What would be the right config lines to block such a possibility ?
> I would like to implement that rule : for other than admin, if page is
> not modified then dont allow saving it.
>
> Might the deltapagesize function (I'm using
> http://www.pmwiki.org/wiki/Cookbook/DeltaBytesRecentChanges) be
> completed, so that 0 modification means saving is unallowed ? Or is it
> doable to use Spamfilters Post Size option ?
>
> Thank you.
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>



-- 
Dominique
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20151216/97fd6a7a/attachment.html>


More information about the pmwiki-users mailing list