Last modified: 2014-08-04 03:33:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70855, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68855 - PHP Parse error: syntax error, unexpected '[' in extensions/MediaWikiAuth/MediaWikiAuth.php on line 283
PHP Parse error: syntax error, unexpected '[' in extensions/MediaWikiAuth/Me...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
MediaWikiAuth (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Jack Phoenix
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-30 13:53 UTC by Nemo
Modified: 2014-08-04 03:33 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nemo 2014-07-30 13:53:14 UTC
PHP Parse error:  syntax error, unexpected '[' in
extensions/MediaWikiAuth/MediaWikiAuth.php on line 283
Errors parsing extensions/MediaWikiAuth/MediaWikiAuth.php

which is:
    unserialize( $this->snoopy->results )['query']['users'][0]['registration']

Hm. Below we see:

			$results = unserialize( $this->snoopy->results );
			if ( isset( $results['query'] ) && isset( $results['query']['userinfo'] ) ) {
				if ( isset( $results['query']['userinfo']['options'] ) ) {
					$options = $results['query']['userinfo']['options'];
Comment 1 Sam Reed (reedy) 2014-07-30 14:07:14 UTC
(In reply to Nemo from comment #0)
> PHP Parse error:  syntax error, unexpected '[' in
> extensions/MediaWikiAuth/MediaWikiAuth.php on line 283
> Errors parsing extensions/MediaWikiAuth/MediaWikiAuth.php
> 
> which is:
>     unserialize( $this->snoopy->results
> )['query']['users'][0]['registration']
> 
> Hm. Below we see:
> 
> 			$results = unserialize( $this->snoopy->results );
> 			if ( isset( $results['query'] ) && isset( $results['query']['userinfo'] )
> ) {
> 				if ( isset( $results['query']['userinfo']['options'] ) ) {
> 					$options = $results['query']['userinfo']['options'];

That's syntax that only works in newer PHP (5.4?)
Comment 2 Nemo 2014-07-30 14:44:16 UTC
Oh, indeed, on all the other machines I have PHP 5.5 but I run php -l on all extensions in tools and forgot that it has

nemobis@tools-login:~$ php --version
PHP 5.3.10-1ubuntu3.13+wmf1 with Suhosin-Patch (cli) (built: Jul 23 2014 13:49:15)

For now I noted the requirement on the extension page, please WONTFIX if this is inteded. https://www.mediawiki.org/w/index.php?title=Extension:MediaWikiAuth&diff=1083102&oldid=1040247
Comment 3 Gerrit Notification Bot 2014-07-31 11:46:13 UTC
Change 150789 had a related patch set uploaded by Jack Phoenix:
Don't require PHP 5.4+

https://gerrit.wikimedia.org/r/150789
Comment 4 Gerrit Notification Bot 2014-08-04 03:20:14 UTC
Change 150789 merged by Legoktm:
Don't require PHP 5.4+

https://gerrit.wikimedia.org/r/150789

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links