PHP changes throwing warning in wiki code -- fixed

Discussion about the site's wikis, including bugs/issues encountered.

Moderator: Moderators

Post Reply
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

PHP changes throwing warning in wiki code -- fixed

Post by koitsu »

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:C ... Wiki/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.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

Thanks for the fix.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

It appears that the reCAPTCHA also needs to be updated for PHP 5.3; otherwise, no changes to a page can be saved.
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.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Post by koitsu »

Nice catch tepples. I'll see what I can dig up on that.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Post by koitsu »

One-line fix for extensions/recaptcha/ReCaptcha.php. Includes line numbers:

Old code:

Code: Select all

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

Code: Select all

    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.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

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.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Post by koitsu »

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.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

Good to see that it was fixed. I checked the plug-in web page (very fast) and there was no mention about this.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Post by koitsu »

User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

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..
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Banshaku wrote:Wiki are easy targets..
Only if they're not monitored for recent changes.
Post Reply