Prevent E_STRICT warning:
authorNick Jenkins <nickj@users.mediawiki.org>
Mon, 20 Aug 2007 07:42:32 +0000 (07:42 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Mon, 20 Aug 2007 07:42:32 +0000 (07:42 +0000)
"Trying to get property of non-object in includes/PageHistory.php on line 257"
Happens because $next === 'unknown', i.e. not an object, on one revision for me with the following fuzz command line test on a local test wiki:

curl --silent --include --globoff  -F 'offset'='&#x0003C;<u '  -F 'dir'='prev'  'http://localhost/wiki/index.php?title=Main_Page&action=history' | less

includes/PageHistory.php

index c92b3dd..d84c351 100644 (file)
@@ -248,7 +248,7 @@ class PageHistory {
                
                $tools = array();
                
-               if ( !is_null( $next ) ) {
+               if ( !is_null( $next ) && is_object( $next ) ) {
                        if( $wgUser->isAllowed( 'rollback' ) && $latest ) {
                                $tools[] = '<span class="mw-rollback-link">'
                                        . $this->mSkin->buildRollbackLink( $rev )