[Mediawiki-l] Strange error that shouldn't theoretically happen

Alex mrzmanwiki at gmail.com
Fri Aug 28 05:25:36 UTC 2009


Juliano F. Ravasi wrote:
 > The error message seems really obvious, except that there should be no
> way for the reported function to finish without returning a value. You
> may check it near the bottom at this address:
> 
> http://svn.juliano.info/svn/mediawiki/extensions/Wikilog/tags/0.7.2/WikilogHooks.php
> 
> 	static function UnknownAction( $action, &$article ) {
> 		if ( $action == 'wikilog' &&
>                      $article instanceof WikilogCustomAction ) {
> 			$article->wikilog();
> 			return false;
> 		}
> 		return true;
> 	}
> 
> I can't see any way that this function would not return either true or
> false. Needless to say, I can't reproduce this behavior on my own
> installation.
> 
> Does anyone have experienced something similar, or have any idea that
> could enlighten the situation?

$article is not passed by reference in the hook call in Wiki.php. I
believe PHP < 5.3 would just silently ignore this (converting the
reference to a value IIRC), PHP 5.3 throws a warning and skips over the
function in a way that breaks the hook call. Removing the & in front of
$article should fix it.

> The user's versions:
> 
> 	WinXP with IIS 5.
> 	MediaWiki 1.15.1
> 	PHP 5.3.0 (cgi-fcgi)
> 	MySQL 5.1.37-community
> 	Wikilog 0.7.2, no other extensions
> 
> Regards,
> Juliano.
> 
> 


-- 
Alex (wikipedia:en:User:Mr.Z-man)



More information about the MediaWiki-l mailing list