Quote:
Originally Posted by ravenscape
It looked the same, except for a comment. I replaced the code and saved the file anyway in case I missed something.
On testing, it still doesn't work.
|
Oops! I just gave you the Parse function, here is the entire code (with remarks):
PHP Code:
/**
* Quotes Validation Class
*
* @product vqbc_rayj2009
*
*/
class vqbc_VerifyQuotes {
/**
* Parses the post message.
*
* @param string text to be validated for matching quote tags
*/
public function Parse($text) { //returns TRUE if bad quote found
$text = preg_replace('#\[quote.*?\]#i','[quote]',$text);
$text = preg_replace('#\[quote\]\[\/quote\]#i','',$text);
$text = preg_replace('#\[noparse\].*?\[\/noparse\]#si','',$text);
$text = $this->do_parse($text);
return preg_match('/\[quote.*?\]|\[\/quote\]/si',$text);
}
/**
* sub-parsing function
*
* @param string (internal call only)
*/
private function do_parse($text) {
if(is_array($text)) { $text = $text[1]; }
$regex = '#\[quote\]((?:[^[]|\[(?!/?quote\])|(?R))+)\[/quote\]#i';
return preg_replace_callback($regex,array($this,'do_parse'),$text);
}
}
--RayJ