Generic Edit Page: Under certain circumstances it is possible to add the same category to a page twice
Closed, DeclinedPublic


Author: robert

When a page is already in a category that contains spaces and when the same category is added again it appears in the list of categories, but disappears on save. Similar behaviour is also seen when using abnormal capitalisation. It appears the JavaScript is not doing sufficient sanitization or checking.

Version: unspecified
Severity: minor
Whiteboard: extension[unmaintained]


bzimport set Reference to bz16394.

herd wrote:

It isn't feasable for javascript to sanitize/normalize titles, as they are very dynamic depending on settings and content language, registered namespaces, namespace aliases, namespace redirects, interwiki prefixes, and interlang prefixes.

I suggest hitting the API before save (or incrementally) to look for dupes using title normalization, for example:|category:Bar|Category:%20Baz

  <n from="category:Bar" to="Category:Bar" />
  <n from="Category: Baz" to="Category:Baz" />

You can also use this for language/alias normalization:|category:Bar|Category:%20Baz

And as an added feature, you can also check the existence of the categories (in the <pages> section, missing="").

Also, you can do all this without ajax:
importScriptURI(wgServer + wgScriptPath + '/api.php?action=query&titles=Category:Foo|category:Bar|Category:%20Baz&format=json&callback=someFunction');
function someFunction(obj) {

//obj is the data


tom.maaswinkel wrote:

Seems to be fixed in the current revision. Can you please review the bug and/or provide steps to reproduce?!

robert wrote:

Confirmed this is still an issue in trunk.

Steps to reproduce:

  1. Edit a page.
  2. Add a category called "Test".
  3. Add a category called "test".
  4. Press save.

Only one category is added to the page, although two were listed on the edit page - the second one should have been normalised to "Test".

According to one of its developer (Mark), Uniwiki extensions for MediaWiki are not under active development anymore "and it is safe to declare them obsolete/wontfix."

It is unlikely that there will be any further active development.

Closing this report as WONTFIX as part of Bugzilla Housekeeping and adding the whitespace entry "extension[unmaintained]". Please feel free to reopen this bug report in the future if anyone takes the responsibility for active development again.

Add Comment