Page MenuHomePhabricator

Regression: MediaWiki 1.26.4 is using incompatible array syntax
Closed, ResolvedPublic

Description

The MediaWiki 1.26.4 tarball contains PHP 5.5 array syntax in Parser.php on line 2149 leading to this error:

Parse error: syntax error, unexpected '[', expecting ')' in includes/parser/Parser.php on line 2149

PHP 5.5 syntax cannot be used as MW 1.26 needs to be compatible with PHP 5.3.

Event Timeline

This is fixed in the actual release branch already. Was not caught during tarbell generation.

T137264 added the according change. Interestingly, the changeset in Gerrit as well as the file in Git (https://github.com/wikimedia/mediawiki/commit/1b24793be41dad9543f65d4ec61b917d1c845be6) contain the correct syntax.

Seems like the wrong file got packaged into the 1.26 tarball.

As soon as the tags are finished, I'll build some new tarballs.

T137264 added the according change. Interestingly, the changeset in Gerrit as well as the file in Git (https://github.com/wikimedia/mediawiki/commit/1b24793be41dad9543f65d4ec61b917d1c845be6) contain the correct syntax.

Seems like the wrong file got packaged into the 1.26 tarball.

Yes. The tarballs are produced prior to the changes making it into Gerrit and through CI. This is a deficiency in our release process for security releases.

demon triaged this task as Unbreak Now! priority.Aug 23 2016, 4:22 AM

@Joergi123 As a quick workaround, you can swap [ for array( and ] for )

@Joergi123 As a quick workaround, you can swap [ for array( and ] for )

I'm aware of that. I opened this issue to get this thing fixed on the WMF side. :-)

Yeah I'll wrap it up shortly :)

Actually the tarballs for 1.26 are still unchanged...

Looking at mediawiki-1.26.4.patch.gz I'm seeing the correct array syntax in Parser.php

I have tried with mediawiki-1.26.4.tar.gz and also a new download still gives me the old file.

$md5sum mediawiki-1.26.4.tar.gz
8b7573fbcc589176d7b35b13b9688508 mediawiki-1.26.4.tar.gz

Maybe it is cached somewhere?

km@km-tp ~/p/sandbox> wget https://releases.wikimedia.org/mediawiki/1.26/mediawiki-1.26.4.tar.gz
--2016-08-22 22:59:20--  https://releases.wikimedia.org/mediawiki/1.26/mediawiki-1.26.4.tar.gz
Resolving releases.wikimedia.org (releases.wikimedia.org)... 2620:0:863:ed1a::3:d, 198.35.26.120
Connecting to releases.wikimedia.org (releases.wikimedia.org)|2620:0:863:ed1a::3:d|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25178007 (24M) [application/x-gzip]
Saving to: ‘mediawiki-1.26.4.tar.gz’

mediawiki-1.26.4.ta 100%[===================>]  24.01M  4.21MB/s    in 5.1s    

2016-08-22 22:59:25 (4.71 MB/s) - ‘mediawiki-1.26.4.tar.gz’ saved [25178007/25178007]

km@km-tp ~/p/sandbox> md5sum mediawiki-1.26.4.tar.gz 
b22a2803307dda0150a339ba50905eed  mediawiki-1.26.4.tar.gz

Obviously it was cached, but not on my side. I even downloaded to the local PC to check (which I had not done before) and it still was the old file.

Anyway, I have now tried with wget -O - https://releases.wikimedia.org/mediawiki/1.26/mediawiki-1.26.4.tar.gz > mediawiki-1.26.4.tar.gz and it finally worked.

It does sit behind varnish, which I suppose is nice except in rare instances like this :)