Merge pull request #13908 from MrPetovan/bug/warnings
Avoid passing null bytes in regular expression in Object\Image
This commit is contained in:
commit
4eefd0a205
|
@ -53,7 +53,7 @@ class Image
|
||||||
*
|
*
|
||||||
* @param string $data Image data
|
* @param string $data Image data
|
||||||
* @param string $type optional, default ''
|
* @param string $type optional, default ''
|
||||||
* @param string $filename optional, default ''
|
* @param string $filename optional, default ''
|
||||||
* @param string $imagick optional, default 'true'
|
* @param string $imagick optional, default 'true'
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
|
@ -100,7 +100,7 @@ class Image
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->imageType == IMAGETYPE_GIF) {
|
if ($this->imageType == IMAGETYPE_GIF) {
|
||||||
$count = @preg_match_all("#\x00\x21\xF9\x04.{4}\x00(\x2C|\x21)#s", $data);
|
$count = preg_match_all("#\\x00\\x21\\xF9\\x04.{4}\\x00[\\x2C\\x21]#s", $data);
|
||||||
return ($count > 0);
|
return ($count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -748,7 +748,7 @@ class Image
|
||||||
case IMAGETYPE_GIF:
|
case IMAGETYPE_GIF:
|
||||||
imagegif($this->image, $stream);
|
imagegif($this->image, $stream);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IMAGETYPE_WEBP:
|
case IMAGETYPE_WEBP:
|
||||||
imagewebp($this->image, $stream, DI::config()->get('system', 'jpeg_quality'));
|
imagewebp($this->image, $stream, DI::config()->get('system', 'jpeg_quality'));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user