Page MenuHomeRustyAug 15 2024, 2:54 PM
Tags
Referenced Files
None
Subscribers

Description

Steps to replicate the issue (include links if applicable):

  • Download the mediawiki tar.gz, extract, set up database following the instructions at https://www.mediawiki.org/wiki/Manual:Installing_MediaWiki
  • Navigate to the path /w/index.php or the script path that was set up and follow installation instructions.
  • Add a single quote in your wiki name during installation. (For example, Rusty's Wiki)

What happens?:
Upon successful installation, navigate to the main page of your wiki. You will be greeted by a blank page, and the HTTP status code is 500 (Internal Server Error).
The following error showed in the error log for me (using Apache):

[Wed Aug 14 15:01:23.748204 2024] [php:error] [pid 14638] [client 10.0.0.108:65072] PHP Parse error:  syntax error, unexpected identifier "s" in /var/lib/mediawiki/LocalSettings.php on line 24

Navigating to line 24, I found this:

$wgSitename = 'Rusty's Wiki';
$wgMetaNamespace = 'Rusty's_Wiki';

Once I escaped the single quotes, the wiki worked.

$wgSitename = 'Rusty\'s Wiki';
$wgMetaNamespace = 'Rusty\'s_Wiki';

What should have happened instead?:
The single quotes should have been escaped during installation. I spent around half an hour searching for possible causes of a 500 error in MediaWiki, because I was not expecting a generated file, of all things, to have a syntax error.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia): 1.42.1

Other information (browser name/version, screenshots, etc.): N/A

Details

Change #1075932 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/core@master] installer: Consistently use double quotes when outputting settings

Change #1075932 merged by jenkins-bot:

[mediawiki/core@master] installer: Consistently use double quotes when outputting settings

Change #1078441 had a related patch set uploaded (by Ammarpad; author: Máté Szabó):

[mediawiki/core@REL1_42] installer: Consistently use double quotes when outputting settings

Change #1078479 had a related patch set uploaded (by Reedy; author: Máté Szabó):

[mediawiki/core@REL1_41] installer: Consistently use double quotes when outputting settings

Change #1078480 had a related patch set uploaded (by Reedy; author: Máté Szabó):

[mediawiki/core@REL1_39] installer: Consistently use double quotes when outputting settings

Change #1078441 merged by jenkins-bot:

[mediawiki/core@REL1_42] installer: Consistently use double quotes when outputting settings

Ammarpad assigned this task to mszabo.

Change #1078480 merged by jenkins-bot:

[mediawiki/core@REL1_39] installer: Consistently use double quotes when outputting settings