Page MenuHomePhabricator

'Name of wiki' field accepts 'MediaWiki' and '#' as the inputs
Closed, ResolvedPublic

Description

Author: nadeejw

Description:
Mediawiki as input to the Name of wiki

Steps to reproduce:

  1. Complete the installation upto the 'Database settings' page.
  2. Input 'MediaWiki' or '#' as the 'name of wiki'.
  3. Click on the 'Continue' button.

Actual result:
System accepts the inputs('MediaWiki' and '#) and does not display 'Enter a site name.' message.

Note : MediaWiki 1.16.1 version does not accepts the 'MediaWiki' and '# as the inputs for 'Name of wiki' field.

Expected result:
System should display 'Enter a site name.' message.


Version: 1.18.x
Severity: minor
OS: Windows XP
Platform: PC

Attached:

mediawiki_Name_of_wiki1.JPG (934×1 px, 128 KB)

Details

Reference
bz26720

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:22 PM
bzimport set Reference to bz26720.
bzimport added a subscriber: Unknown Object (MLST).

nadeejw wrote:

as the input to the 'Name of wiki' field

Attached:

mediawiki_Name_of_wiki2.JPG (934×1 px, 127 KB)

MediaWiki is a valid site name, however it is not a valid namespace name. This is a known issue and needs (some sort) of resolving. See comments New-installer_issues#.24wgSitename_forgotten.3F

  1. is not a valid site name and we should show an error.

(In reply to comment #2)

See comments
New-installer_issues#.24wgSitename_forgotten.3F

See comments http://www.mediawiki.org/wiki/New-installer_issues#.24wgSitename_forgotten.3F

I chopped part of the URL

Fixed namespace conflicting in r82980.

Still need to fix # as sitename.

sumanah wrote:

Is this still reproducible? Am boldly marking this as easy - please remove the keyword if this is not a suitable thing for a new MediaWiki developer (who already knows PHP) to try to fix.

dilexie wrote:

What are we actually talking about validating for?
I'm new to MediaWiki development and I was going to start on fixing this, but I'm not clear as to the issue at hand. The steps described ('#' case) no longer pass validation because the generated empty-string namespace gets rejected, but whether this means the bug was fixed in passing is not clear to me because I'm not sure what the actual bug is/was. Part of my confusion is also that I find the notion that '#' would be a uniquely problematic name suspect--Shouldn't it be something more like names beginning with '#'? But unless the site name gets used in db table names, I couldn't find any usage of # that seemed like it would make this a problem either way.

If it's not worth the trouble clarifying this for a newbie, no problem, but I think in that case the 'easy' keyword might be better removed.

Related URL: https://gerrit.wikimedia.org/r/59067 (Gerrit Change If64138034e6bf874d66b76a49e8bf42d617033f4)

ganeshaditya1 wrote:

Fixed the bug please review it Change id:
If64138034e6bf874d66b76a49e8bf42d617033f4

ganeshaditya1 wrote:

https://gerrit.wikimedia.org/r/#/c/59390/
I am very sorry I messed up with my previous upload. I finally figured out git :) My slow internet truely hindered my learning :)

(In reply to comment #6)

What are we actually talking about validating for?
I'm new to MediaWiki development and I was going to start on fixing this, but
I'm not clear as to the issue at hand. The steps described ('#' case) no
longer
pass validation because the generated empty-string namespace gets rejected,
but
whether this means the bug was fixed in passing is not clear to me because
I'm
not sure what the actual bug is/was. Part of my confusion is also that I find
the notion that '#' would be a uniquely problematic name suspect--Shouldn't
it
be something more like names beginning with '#'? But unless the site name
gets
used in db table names, I couldn't find any usage of # that seemed like it
would make this a problem either way.

If it's not worth the trouble clarifying this for a newbie, no problem, but I
think in that case the 'easy' keyword might be better removed.

I think the original main problem (of conflicting namespace names) was the worse problem, which I fixed a long time ago.

I really don't think anything else needs fixing here at all.

ganeshaditya1 wrote:

What about # as the media wiki name ?
I am making change to this cause I just got an email that says that MediaWiki is an acceptable name for the site

Well that could possibly be fixed, but if so it should check for any invalid namespace characters, not just #.

ganeshaditya1 wrote:

What are invalid namespace characters ? I will place them in an array and compare them and when I find a match I will throw an error. I will push that as an amendment to this

dilexie wrote:

The namespace is used as a component in page titles, so the restrictions that apply to the namespace name should be the same as the restrictions that apply to a page name. This is actually already in place (see lines 737+ of WebInstallerPage.php), which means I think we can safely conclude that there's no further development to be done with regards to this report.

ganeshaditya1 wrote:

(In reply to comment #14)

The namespace is used as a component in page titles, so the restrictions that
apply to the namespace name should be the same as the restrictions that apply
to a page name. This is actually already in place (see lines 737+ of
WebInstallerPage.php), which means I think we can safely conclude that
there's
no further development to be done with regards to this report.

It is not necessary that the site name should be the same as the namespace name right ? I can still name my site as # and name my project namespace as MyWiki, by choosing the third option in the installer(The one that says choose a separate namespace name). However if I choose to use the project namespace as same as the sitename, all the restrictions that are forced on the namespace start to apply on the sitename as well. Also these restrictions on namespaces tend to replace any violation with a empty string and do not provide the user with clarity regarding why there sitename is being rejected. But am not sure if all the namespace restrictions SHOULD apply to the sitename as well or not. I have written a mail to chad regarding the same and am awaiting his reply on this.

Please don't send private e-mails, keep discussion on the bug...

The validation isn't actually performed on the sitename as far as I can see, only on the namespace (it fetches the initial namespace from the sitename, which might be the source of your confusion).

And no, not all the namespace validation applies to wgSiteName.

I really don't see a bug anymore...

I'm going to mark this as fixed. The sitename can be almost anything, and it doesn't matter if it's the same as the meta namespace name or not (it can be, but doesn't have to be, and isn't when you use MediaWiki as the sitename). There's plenty of workarounds (able to specify your own meta namespace), and we don't allow namespaces that don't pass validation.