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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 23 2016, 4:16 AM
demon added a subscriber: demon.Aug 23 2016, 4:19 AM

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

demon added a comment.Aug 23 2016, 4:19 AM

(This also affected 1.23)

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.

demon added a comment.Aug 23 2016, 4:21 AM

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

demon added a comment.Aug 23 2016, 4:22 AM

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
Restricted Application added subscribers: Luke081515, TerraCodes. · View Herald TranscriptAug 23 2016, 4:22 AM
demon added a comment.Aug 23 2016, 4:24 AM

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

Joergi123 added a comment.EditedAug 23 2016, 4:26 AM

@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. :-)

demon added a comment.Aug 23 2016, 4:26 AM

Yeah I'll wrap it up shortly :)

Actually the tarballs for 1.26 are still unchanged...

demon added a comment.Aug 23 2016, 5:44 AM

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

Joergi123 added a comment.EditedAug 23 2016, 5:53 AM

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
Joergi123 added a comment.EditedAug 23 2016, 6:15 AM

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.

demon added a comment.Aug 23 2016, 6:55 AM

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