Page MenuHomePhabricator

wfTimestamp() called with illegal output type
Closed, ResolvedPublic

Description

I use a wiki server similar to commons which transcludes images to other servers. And I got the following error when trying to edit a page concerning an image description:
Exception from line 1475 of /var/www/html/mediawiki/phase3/includes/GlobalFunctions.php: wfTimestamp() called with illegal output type.

Looking at getTimestamp() called in File.php, I found that the first argument is missing. Thus I added 0:
function getTimestamp() {

		$path = $this->getPath();
		if ( !file_exists( $path ) ) {
			return false;
		}
		return wfTimestamp(0, filemtime( $path ) );

}
And it works now but I am surprised by this bug and my response is only a workaround.


Version: 1.12.x
Severity: critical

Details

Reference
bz13649

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:07 PM
bzimport set Reference to bz13649.
bzimport added a subscriber: Unknown Object (MLST).

This was fixed on trunk in r32815.

Copied to 1.12 branch in r33000

  • Bug 13923 has been marked as a duplicate of this bug. ***

lionelbrits wrote:

When I implement this fix on 1.12.0, I get the following error:

Warning: Invalid argument supplied for foreach() in /home/.angelina/lionelbrits/physics.thetangentbundle.net/w/includes/ImagePage.php on line 428

Is there a more complete work-around besides upgrading?