1--TEST-- 2Testing null byte injection in imagewebp 3--EXTENSIONS-- 4gd 5--SKIPIF-- 6<?php 7$support = gd_info(); 8if (!isset($support['WebP Support']) || $support['WebP Support'] === false) { 9 print 'skip webp support not available'; 10} 11?> 12--FILE-- 13<?php 14$image = imagecreate(1,1);// 1px image 15try { 16 imagewebp($image, "./foo\0bar"); 17} catch (TypeError $e) { 18 echo $e->getMessage(), "\n"; 19} 20?> 21--EXPECT-- 22imagewebp(): Argument #2 ($file) must not contain null bytes 23