function verify_image($file) { $txt = file_get_contents($file); $image_safe = true; if (preg_match('#&(quot|lt|gt|nbsp|]+)style=([\`\'\"]*).*expression\([^>]*>#iU", $txt)) { $image_safe = false; } elseif (preg_match("#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU", $txt)) { $image_safe = false; } elseif (preg_match("#]*>#i", $txt)) { $image_safe = false; } return $image_safe; }