PDA

View Full Version : [bug] PHP code is unnecessarily trimmed


Chen
Mon 25th Nov '02, 5:28pm
This is a bug in both vB2 and vB3, trim() should not be used here:
if (strpos($code, '<?') === false)
{
$code = '<? ' . trim($code) . ' ?>';
$addedtags = 1;
}
Why? View this post's source and see for yourself.

Raz Meister
Mon 25th Nov '02, 5:59pm
if (!preg_match('~^\\s*<?~s')) {
$code = '<? ' . trim($code) . ' ?>';
$addedtags = 1;
}BTW, \ is stripped from php code unnecessarily.