OK i tested it and found bad news, it works if there only one tag, but if there more than one tag, it fails to find the second tag, this is what i mean.
[lock id="222" price="2"]hehe[/lock] - Reports OK
[lock id="222a" price="2"]hehe[/lock] - Reports OK
but if the bad tag was alone like this
[lock id="222a" price="2"]hehe[/lock] - Reports BAD
I also tryed using the preg_match_all function and the same result.
I have solve this with the following
if ($tag_count = preg_match_all("#\[lock id=([\"']|"|&\#039;|&\#39;)(.+?)([\"']|"|&\#039;|&\#39;) price=([\"']|"|&\#039;|&\#39;)(.+?)([\"']|"|&\#039;|&\#39;)\](.+?)\[/lock\]#is", $pclass->post['post'], $tag_matches)) {
for ($i = 0; $i <= $tag_count - 1; $i++) {
if (!is_numeric($tag_matches[2][$i]) or !is_numeric($tag_matches[5][$i])) {
$pclass->class->obj['post_errors'] = "cant_post_purchase_lock_problem";
$pclass->show_form();
}
}
}