Last modified: 2013-05-16 10:07:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48404, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46404 - added_lines does not work in AbuseFilter, need to use to new_wikitext
added_lines does not work in AbuseFilter, need to use to new_wikitext
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
REL1_20-branch
All All
: Lowest trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-21 06:15 UTC by zoglun
Modified: 2013-05-16 10:07 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description zoglun 2013-03-21 06:15:14 UTC
For some unknown reason The rules that I copy from wikipedia do not work in my wiki. 

!("bot" in user_groups) & !("sysop" in user_groups) & action == "edit" & 
(article_namespace == 0) & 
(count("[[", added_lines) != count("]]", added_lines) & 
count("[", added_lines) != count("]", added_lines) | 
(("[[]" in added_lines) | ("[]]" in added_lines)))

this rule still working in zh ver wikipedia but not in my wiki

MediaWiki	1.20.3
PHP	5.4.9 (fpm-fcgi)
MySQL	5.5.28-debug



We have to replace added_lines to new_wikitext. Any idea about why this happen?


!("sysop" in user_groups) & action == "edit" & 
(article_namespace == 0) & 
(count("[[", new_wikitext) != count("]]", new_wikitext) & 
count("[", new_wikitext) != count("]", new_wikitext) | 
(("[[]" in new_wikitext) | ("[]]" in new_wikitext)))
Comment 1 Andre Klapper 2013-03-21 10:09:24 UTC
Just to make sure, you use the 1.20 branch of AbuseFilter?
Comment 2 zoglun 2013-03-21 10:10:06 UTC
yes, 1.20 latest stable version.
Comment 3 Nischay Nahata 2013-03-21 11:13:32 UTC
I think it worked for me..

I edited a page with '[abc' and the filter was hit.
Comment 4 zoglun 2013-03-21 20:58:59 UTC
(In reply to comment #3)
> I think it worked for me..
> 
> I edited a page with '[abc' and the filter was hit.

So what is your PHP version?
Comment 5 Nischay Nahata 2013-03-22 05:03:01 UTC
PHP 5.4.7
Comment 6 zoglun 2013-03-26 20:28:11 UTC
Today I tried to disable all the extensions expect abusefilter. I tried 120 stable and newest version, none of then work in my wiki(actually none of them able to use added_lines)So I think this is not caused by extension conflict. I tried to delete

abuse_filter 
abuse_filter_action 
abuse_filter_history 
abuse_filter_log

in my database and then run update.php but added_lines still not work. So what could cause this problem?

http://wiki.moegirl.org/Special:%E9%98%B2%E6%BB%A5%E7%94%A8%E8%BF%87%E6%BB%A4%E5%99%A8/examine/137386

Here is a example log, looks like abusefilter can't get the "edit_diff" therefore it can't generate anything in added_links.
Comment 7 Liangent 2013-05-12 15:51:49 UTC
(In reply to comment #6)
> http://wiki.moegirl.org/Special:
> %E9%98%B2%E6%BB%A5%E7%94%A8%E8%BF%87%E6%BB%A4%E5%99%A8/examine/137386

It looks annoying that I can't view this page without logging in, but when I try to create an account, it gives me a question and I have no idea about its answer. :(

(specifically it asks me for the name of something in an image that I've never seen)
Comment 8 zoglun 2013-05-13 02:21:08 UTC
Hi Liangent,
I am sorry for bother you by the verification system. These verify are setted for both spam prevent and user selected. You can register account through our En version since they use same user data table.

http://en.moegirl.org/index.php?title=Special:UserLogin&type=signup&returnto=Mainpage

By the way, there is one validation question for En version too, following page may help you: http://en.wikipedia.org/wiki/Hatsune_Miku.

If you still can't access the examine page, or you can't register. Please let me know, I will set up an Administrators account for you.

examine page: http://zh.moegirl.org/Special:%E9%98%B2%E6%BB%A5%E7%94%A8%E8%BF%87%E6%BB%A4%E5%99%A8/examine/137386

sincerely,
zoglun
Comment 9 Liangent 2013-05-13 05:53:00 UTC
Hmm it seems I've already created an account in 2012. I'm not sure why I did that.

I guess you have misconfigured your path to diff utilities, based on behaviors of other editing functionalities. Maybe you can have a look at these configuration settings:

https://www.mediawiki.org/wiki/Manual:$wgDiff
https://www.mediawiki.org/wiki/Manual:$wgDiff3
Comment 10 zoglun 2013-05-13 08:45:31 UTC
$wgDiff = "/usr/bin/diff"; 
$wgDiff3 = "/usr/bin/diff3"; 

I tried these two via CLI, both of then work.
Comment 11 Liangent 2013-05-13 10:14:32 UTC
(In reply to comment #10)
> $wgDiff = "/usr/bin/diff"; 
> $wgDiff3 = "/usr/bin/diff3"; 
> 
> I tried these two via CLI, both of then work.

I still doubt it's related to some configuration issues...

What if you set $wgDiff = false; (so it falls back to use PHP diff engine)

If everything works in this way, it must be a problem of diff instead of AbuseFilter.
Comment 12 zoglun 2013-05-15 23:00:34 UTC
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW!

IT WORKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK!!!!!

OH MY GOD I AM SO EXCITING THAT THIS EXTENSION WORKING NOW!!

When 
$wgDiff = false; 
$wgDiff3 = false; 
added to localsettings.php the Abusefilter work! Although the wiki become perceptible slow, it work!
Comment 13 Liangent 2013-05-16 04:27:09 UTC
So it doesn't sound like an AbuseFilter bug... If you really want to consider it as a bug, it's just some imperfect error handling (but generally we don't try to spot improper configurations) in core.


Maybe you can try to manually execute (with maintenance/eval.php) lines at:

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/GlobalFunctions.php;h=50758c89f7afdc687f80385c4cdc7ad0dac64677;hb=375d04b02cfb9f1e4a1ecc5193f95010c76fbf0d#l2967

from line 2967 to 2992 and see what's going wrong.
Comment 14 zoglun 2013-05-16 10:07:15 UTC
Solved, allow "popen" in php.ini, and then AbuseFilter work as normal. This is a "dangerous" function, and looks like not necessary.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links