Problem with preg_match_all in phpcrawlerutils.class.php
Status: Alpha
Brought to you by:
astellar
In file: phpcrawlerutils.class.php 201
if there is strlen($source) >= 400000 preg_match_all produces a segmentation fault.
I solved the problem adding this:
if ( strlen($source) > 50000 ) {
$source = substr($source, 0, 50000);
}
preg_match_all("/<[ ]{0,}a[ \n\r][^<>]{0,}(?<= |\n|\r)(?:".$match_part.")[ \n\r]{0,}=[ \n\r]{0,}[\"|']{0,1}([^\"'>< ]{0,})[^<>]{0,}>((?:(?!<[ \n\r]*\/a[ \n\r]*>).)*)<[ \n\r]*\/a[ \n\r]*>/ is", $source, $regs);
You can contact me at: <a href="http://www.informaticaautonomos.com">http://www.informaticaautonomos.com</a>