Page MenuHomePhabricator

"PHP Warning: XMLReader::open(): Unable to open source data" on JPG data
Open, Needs TriagePublic

Description

MimeAnalyzer::doGuessMimeType() uses XmlTypeCheck to find the type of a file. When the file does not contain XML data (e.g JPEG data) the following is emitted:

PHP Warning:  XMLReader::open(): Unable to open source data

Surrounding the call to XmlTypeCheck with

		MediaWiki\suppressWarnings();
		$xml = new XmlTypeCheck( $file );
		MediaWiki\restoreWarnings();

solves the problem.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 26 2017, 3:18 PM

Change 374039 had a related patch set uploaded (by MarkAHershberger; owner: MarkAHershberger):
[mediawiki/core@REL1_28] "PHP Warning: XMLReader::open(): Unable to open source data" on JPG data

https://gerrit.wikimedia.org/r/374039

Change 374041 had a related patch set uploaded (by MarkAHershberger; owner: MarkAHershberger):
[mediawiki/core@master] "PHP Warning: XMLReader::open(): Unable to open source data" on JPG data

https://gerrit.wikimedia.org/r/374041

Change 374039 abandoned by Reedy:
"PHP Warning: XMLReader::open(): Unable to open source data" on JPG data

Reason:
REL1_28 is EOL

https://gerrit.wikimedia.org/r/374039

Change 374041 abandoned by markahershberger:
"PHP Warning: XMLReader::open(): Unable to open source data" on JPG data

https://gerrit.wikimedia.org/r/374041

MarkAHershberger removed MarkAHershberger as the assignee of this task.May 20 2020, 6:43 PM