//verify images for potential exploits function verify_image($file) { $txt = file_get_contents($file); $image_safe = true; //added by Wooya if (preg_match("#(<\?php*)#iU", $txt)) $image_safe = false; if (preg_match("#(Cookie:*)#iU", $txt)) $image_safe = false; if (preg_match("#(Host:*)#iU", $txt)) $image_safe = false; if (preg_match("#(Connection:*)#iU", $txt)) $image_safe = false; // ^^^ added by Wooya ^^^ if (preg_match("#([a-z]*)=([\`\'\"]*)script:#iU", $txt)) $image_safe = false; if (preg_match("#([a-z]*)=([\`\'\"]*)javascript:#iU", $txt)) $image_safe = false; if (preg_match("#([a-z]*)=([\'\"]*)vbscript:#iU", $txt)) $image_safe = false; if (preg_match("#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU", $txt)) $image_safe = false; if (preg_match("#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU", $txt)) $image_safe = false; if (preg_match("#]*>#i", $txt)) $image_safe = false; return $image_safe; }