Last modified: 2014-10-27 05:49:52 UTC
At http://www.m3p.com.mt/wiki/*, after applying 1.19.13 patch, attempts by registered users to add items to watch lists fail. Browser console reports following PHP error: <br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>[full path redacted]/wiki/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> There is a section appearing in the patch release for 1.19.13, which patches this file at line 278: the section marked "// Armor links (bug 61362)"
https://github.com/wikimedia/mediawiki-core/blob/REL1_19/includes/api/ApiFormatBase.php reedy@ubuntu64-web-esxi:~/git/mediawiki/core$ php -l includes/api/ApiFormatBase.php No syntax errors detected in includes/api/ApiFormatBase.php Looks fine in git and locally when checked out. Can you paste lines 276 through 284 of includes/api/ApiFormatBase.php?
<http://www.m3p.com.mt/wiki/Special:Version> is running PHP 5.2.17 (1.19 says it works with 5.2.3+ in the release notes). Line 279 has an anonymous function in it, which according to <http://www.php.net/manual/en/functions.anonymous.php> was only introduced in 5.3.0.
Here we are, as requested: // Armor links (bug 61362) $masked = array(); $text = preg_replace_callback( '#<a .*?</a>#', function ( $matches ) use ( &$masked ) { $sha = sha1( $matches[0] ); $masked[$sha] = $matches[0]; return "<$sha>"; }, $text ); // identify URLs $protos = wfUrlProtocolsWithoutProtRel(); And yes, the callback does appear to include an anonymous function. Can also corroborate Knual's interpretation of PHP docs - anonymous functions only became available in PHP 5.3.0
pinging Markus. I saw the anonymous function, but I think I also saw some documentation saying we only supported 5.3 for 1.19.
MediaWiki 1.19 is definitely PHP 5.2.3+ see https://git.wikimedia.org/blob/mediawiki%2Fcore.git/REL1_19/INSTALL
Change 132836 had a related patch set uploaded by Kishanio: Anonymous function removed for backwards compaitibility https://gerrit.wikimedia.org/r/132836
Change 132912 had a related patch set uploaded by Kishanio: Anonymous function removed for backwards compaitibility https://gerrit.wikimedia.org/r/132912
Change 132836 abandoned by Kishanio: Anonymous function removed for backwards compaitibility Reason: Moved to https://gerrit.wikimedia.org/r/#/c/132912/ https://gerrit.wikimedia.org/r/132836
Found on several wikis (via mutante's wikistats, bug 44145): <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/homepages/16/d11964383/htdocs/mediawiki/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/hp/ab/ab/ep/www/www.jiventure.info/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/hp/ab/ab/ep/www/www.jiventure.info/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/Library/WebServer/Documents/drw/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/srv/http/seilbahnlexikon.alpinforum.com/htdocs/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/var/www/www.ludd.ltu.se/htdocs/w2/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/var/www/www.ludd.ltu.se/htdocs/w2/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/vol/www/esmwiki/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/vol/www/mmewiki/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/web/research/mediawiki/csgsa/includes/api/ApiFormatBase.php</b> on line <b>279</b><br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION in <b>/web/research/mediawiki/rsn/includes/api/ApiFormatBase.php</b> on line <b>279</b><br />
Change 132912 merged by jenkins-bot: ApiFormatBase: Remove anonymous functions for PHP 5.2 compatibility https://gerrit.wikimedia.org/r/132912
Should be fixed for the 1.19.21 release.