eregi to preg
Posted on
16th Feb 2014 07:03 pm by
admin
Im converting my regex for php 5.3 and I am stuck on the following
Code: [Select]if((eregi("<[^>]script*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*object*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*iframe*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*applet*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*meta*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]style*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*form*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*img*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*onmouseover*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]body*"?[^>]*>", $secvalue) && !eregi("<[^>]tbody*"?[^>]*>", $secvalue)) ||
(eregi("([^>]*"?[^)]*)", $secvalue)) ||
(eregi(""", $secvalue)) ||
(eregi("forum_admin", $sec_key)) ||
(eregi("inside_mod", $sec_key))) {
block_ip($blocker_row);
}
anyone got any ideas on how to convert this to preg.so far I have this
Code: [Select]$html_regex = '{
^(
(?: <scriptb[^>]*>.*?</script> # script block
| <objectb[^>]*>.*?</object> # object block
| <iframeb[^>]*>.*?</iframe> # iframe block
| <appletb[^>]*>.*?</applet> # applet block
| <metab[^>]*>.*?</meta> # meta block
| <styleb[^>]*>.*?</style> # style block
| <formb[^>]*>.*?</form> # form block
| <imgb[^>]*>.*?</img> # img block
| <onmouseoverb[^>]*>.*?</onmouseover> # onmouseover block
| <bodyb[^>]*>.*?</body> # body block
)*+
)$
}isx';
if (preg_match($html_regex, $html_string))
No comments posted yet
Your Answer:
Login to answer
227
48
Other forums
get font info from a font file
hello,
Does anyone know how to get font info from a font file ... using php of course !
<
Show message after entering data
Hello Colleagues
I would like to display messages after entering the data example: "
dat
set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on cli
Logic question
im wondering what's the best method to do the above list:
it is for alliance @ MMORPG game
Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values
PHP Code / Script To check weather the given email exists in a domain
Hi,
I want to implement the following in my web page
in sign up we will ask to enter u
Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I
PHP template help
Ok, I don't know if anyone can help me but I am using PHP templates to make a site. I am a newbie an
Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :
Help with php code
Hello, can anyone tell me why this php word trap fails to work,
and the trigger words get blow r