PHP changes throwing warning in wiki code -- fixed

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
PHP changes throwing warning in wiki code -- fixed
by on (#62249)
Since upgrading to PHP 5.3, the following warning was being thrown:

Warning: Parameter 1 to Language::getMagic() expected to be a reference, value given in /home/ndwiki/www/w/includes/StubObject.php on line 58

Bug reference: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/55429

Looks like a one-line fix (removal of "&" character (reference declaration) in the function argument).

Since the fix is only available in MediaWiki 1.6 -- which isn't out yet -- I decided to modify www/w/languages/Language.php to include the one-line fix.

by on (#62255)
Thanks for the fix.

by on (#62303)
It appears that the reCAPTCHA also needs to be updated for PHP 5.3; otherwise, no changes to a page can be saved.
Quote:
Warning: Parameter 1 to ReCaptcha::confirmEdit() expected to be a reference, value given in /home/ndwiki/www/w/includes/Hooks.php on line 117
Internal error
From Nesdev wiki
Jump to: navigation, search

Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.

by on (#62324)
Nice catch tepples. I'll see what I can dig up on that.

by on (#62325)
One-line fix for extensions/recaptcha/ReCaptcha.php. Includes line numbers:

Old code:

Code:
    100         function confirmEdit( &$editPage, $newtext, $section ) {


New code:
Code:
    100         function confirmEdit( $editPage, $newtext, $section ) {


Can you test again, tepples? I was able to do an update but I wasn't prompted for the captcha.

by on (#62329)
koitsu wrote:
Can you test again, tepples? I was able to do an update but I wasn't prompted for the captcha.

The CAPTCHA happens only if you register or add an external link. (Wikipedia disables CAPTCHA for "autoconfirmed" users with 4 days and 10 edits; nesdevWiki appears not to.) This edit went through.

by on (#62335)
Cool, thanks much! I'll add something on my blog about said bug/issue + the fix, so others on the 'net can fix their stuff. I couldn't find anything on the reCAPTCHA forum about it.

by on (#62341)
Good to see that it was fixed. I checked the plug-in web page (very fast) and there was no mention about this.

by on (#62398)
http://koitsu.wordpress.com/2010/06/04/mediawiki-and-recaptcha-fixes-for-php-5-3/

That's all folks.

by on (#62414)
It seems to be working... Since the spammers were able to add some link :lol: I don't now why those human spammer for essays seems to target the nesdev wiki. duh.

edit:

In a way I know why to put link to random site: just to increase their SEO on google since they don't link back to our site. Wiki are easy targets..

by on (#62420)
Banshaku wrote:
Wiki are easy targets..

Only if they're not monitored for recent changes.