[php-src] Issue #9611: Degree symbol embedded in EXIF Tag UserComment
| From: | bquimby1 | Date: | Sat, 24 Sep 2022 15:34:34 +0000 |
| Subject: | [php-src] Issue #9611: Degree symbol embedded in EXIF Tag UserComment | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242460@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9611
Author: bquimby1
### Description
The following code:
exif_read_data($somefile,'',true)
It appears that when I embed a degree character (Shift+Option+8 | Alt+0176) anywhere in a string
assigned to 'UserComment' the string gets corrupted when read by exif_read_data(). If I
embed the symbol in any other string (so far) (i.e. ImageDescription) everything is as expected.
I embedded the symbol as the first character in a string as follows: "°2022..." Checking
the first character of the string using
ord(substr($string,0,1)) yielded '50'
or the character 2. exif_read_data apparently ignored the leading degree symbol.
So embedding the degree symbol anywhere in the UserComment tag -
Resulted in this output:
��2�0�2�2� �C�a�m�p� �-� � �D�a�y� �t�r�i�p�
�t�o� �C�a�m�p�.� �T�h�e� �l�a�t�e�s�t�
�v�e�r�s�i�o�n� �o�f� �t�h�e� �L�o�o�p�
�S�t�a�n�d�.� � �W�e� �r�e�p�l�a�c�e�d� �i�t�
�o�n� �A�u�g�u�s�t� �1�0�t�h� �2�0�2�2�.
But I expected this output instead:
2022 Camp - I know three old dudes who are pretty proud of themselves for getting this stand up. It
replaces John's North Stand that was crushed by a blow down over the Winter.
### PHP Version
PHP 8.1.9
### Operating System
OSX 12.3.1