Compile {if} tag

From: Date: Mon, 13 Jan 2003 12:38:11 +0000
Subject: Compile {if} tag
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-524@lists.php.net to get a copy of this message
Hi there, it seems to me that the latest _compile_if_tag() is missing some stuff :( {if substr($theUrl, -4) eq ".pdf"}PDF{else}HTML{/if} The regexp group "valid non-word token" matches only pure numbers, so "-4)" is matched as token instead of "-4" alone. If I'm not wrong, the same should happen with floating point numbers, too. The regexp could be enhanced to match any numbers, like "-?\d*.?\d+" does (nope, doesn't match exponents...). In addition to that, binary OR (|) and XOR (^) are(?) supported, whereas AND (&) and NOT (~) are missing (not sure about that, since the CASEs were missing for all, and I'm too lazy to test it right now... :) Yours, Stefan

« previous php.smarty.dev (#524) next »