Fix XMP parser errors due to trailing nullchar
authorDerk-Jan Hartman <hartman.wiki@gmail.com>
Wed, 11 Sep 2019 22:12:22 +0000 (00:12 +0200)
committerReedy <reedy@wikimedia.org>
Thu, 12 Sep 2019 00:47:28 +0000 (00:47 +0000)
commit7668c368fda48d8a8c18ae8e223b12bafd0bd4c6
tree27ac16c5000cbd1ec105fb225ef0fbb276d1cf83
parentfe531ceb271ee9418a23a092276a7b81cedabd2d
Fix XMP parser errors due to trailing nullchar

JPEG files can have trailing \0 chars at the end of the XMP value. Use
trim() to remove these from the string value.

Bug: T118799
Change-Id: Id4ab223ef432e5d2c0dd3b4e332320db02422700
(cherry picked from commit 9ce26a564d066a33ba7ae2a6502e3d57e7e4d48b)
includes/media/JpegMetadataExtractor.php
tests/phpunit/data/media/jpeg-xmp-nullchar.jpg [new file with mode: 0644]
tests/phpunit/includes/media/JpegMetadataExtractorTest.php