This is an old revision of the document!
The biggest difference is in handling of entities. Entities are now unescaped before passing to expressions, i.e. ${php:strlen('"')}
“sees” just the quote character and returns 1
. In previous versions entities were passed as-is to the expressions (and that example would return 6
).
Newly added unescaping of entities can expose encoding bugs. Make sure your pages declare document encoding:
For XHTML it's best to send Content-Type:application/xhtml+xml;charset=UTF-8
or Content-Type:text/html;charset=UTF-8
HTTP headers.
text/xml
MIME type, use application/xml
instead.
In HTML add appropriate <meta>
tag or send Content-Type:text/html;charset=UTF-8
HTTP header.
$phptal->setEncoding('ISO-8859-…')
(or just switch to UTF-8 already! :)PHPTAL_VERSION
have been removed. Remove any PHPTAL-specific define()
s and use class methods (available in earlier versions too) for configuration (e.g. $phptal->setPhpCodeDestination('/tmp/phptal/')
for custom temp directory.)PHPTAL.php
.