Topic on Project:Support desk

Preventing to create empty pages

26
Summary by Fokebox

Find out some details

Fokebox (talkcontribs)

I have a problem at my wiki, most of the users are school pupils and they often create just empty pages adding just a couple words. Are there any tool that can prevent to create empty pages or pages with just couple of words?

Wargo (talkcontribs)
Ciencia Al Poder (talkcontribs)

Extension:AbuseFilter will work for this. You can create a rule like this:

 page_id==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)
Fokebox (talkcontribs)

Guys, can you help me please. How to download Extension:AbuseFilter for older version of my wiki. I have 1.29.1

Bawolff (talkcontribs)

you should use a newer version. Mediawiki 1.29 hasnt been recieving security updates for over a year.


That said, you can get old versions from github https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/archive/REL1_29.zip . I'm not sure if github downloads include vendor dependencies (prob not) so you also have to run composer install --no-dev in the AbuseFilter directory after you have unpacked it

Fokebox (talkcontribs)

It seems to be that I have successfully installed the extension. So we shall I put this code?:

page_id==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

In localsettings.php file?

Ciencia Al Poder (talkcontribs)
Fokebox (talkcontribs)

Yes, now I try to use it ) Thanks

So, when I try to save the filter in this code:

page_id==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

I have a system mistake, that there is an error in syntax

Bawolff (talkcontribs)

Syntax seems fine to me, are you sure you tried to add that code exactly?

Fokebox (talkcontribs)
Bawolff (talkcontribs)

Try

article_articleid==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

instead (older versions of abusefilter might require that instead).

Fokebox (talkcontribs)

Thanks! Now all seems to be fine, all works!

Fokebox (talkcontribs)

Can you also help me how to create a filter that will not allow to non-registered users to insert external links in articles?

Matěj Suchánek (talkcontribs)
action == 'edit'
& user_age == 0
& article_namespace == 0
& added_lines rlike 'https?://'
Fokebox (talkcontribs)

Hi! Can you please help me. I want to make an exception for uploaded files. So it it necessary to provide description and the filter blocks uploading if there isn't such description. So I want users allow to upload files without descriptions

Matěj Suchánek (talkcontribs)

Adding article_namespace !== 6 & or action !== 'upload' & should suffice.

Fokebox (talkcontribs)

Thanks!

The whole code looks now so:

article_articleid==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 30)
 & action !== 'upload'
Fokebox (talkcontribs)

Hello! I have updated my wiki to 1.35 and enables VisualEditor. So if I upload the image via VisualEditor, it shows me a message that cannot create empty page. Shall I add to the code exception for uploading a file via VisualEditor

Wargo (talkcontribs)

Maybe set exception to "File" namespace.

Fokebox (talkcontribs)

I can try, can you please let me know how to make such exception to the code I have already

Ciencia Al Poder (talkcontribs)

Change action !== 'upload' to article_namespace !== 6

Fokebox (talkcontribs)

I guess I do something wrong. I have following code:

article_articleid==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 30)
 & action !== 'upload' to article_namespace !== 6

And I cannot save it as I have message with error

Matěj Suchánek (talkcontribs)

That to isn't valid. You were recommended to replace action !== 'upload' with article_namespace !== 6.

Fokebox (talkcontribs)

Now all is fine. Thanks

Fokebox (talkcontribs)

Hi! Could you please help?

i have the code as above and it works fine. But how should I change it if I want allow non-registered users to change the text and link itself on the existing page with such text and link, but at the same time disallow non-registered users to create new pages with links?

Fokebox (talkcontribs)

Thx! Works perfect!

Reply to "Preventing to create empty pages"