Re: [SMARTY] (Fwd) Re: [SMARTY] adding vars to array
| From: | Joakim Andersson | Date: | Sat, 13 Jul 2002 10:19:13 +0000 |
| Subject: | Re: [SMARTY] (Fwd) Re: [SMARTY] adding vars to array | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5276@lists.php.net to get a copy of this message | ||
On Fri, Jul 12, 2002 at 04:39:31PM +0200, Peter Billen wrote:
> I WILL disable error_reporting when I publish my site, because
> errors/notices/warnings can be useful for hackers/.. if you are using
> header(), so they can see some outputs of restricted areas.
Why not use a custom error handler which will log or mail the error
message to you but not show anything to the user? That way you will know
when something breaks and also hopefully know why but the end users
won't get the detailed error message. Your error handler can for example
show some boring generic "An error has occurred" message.
>> -----Original Message-----
>> From: Ferdinand Beyer [mailto:fbeyer@clickhand.de]
>> Sent: vrijdag 12 juli 2002 16:30
>> To: peter@clueless.be
>> Subject: RE: [SMARTY] (Fwd) Re: [SMARTY] adding vars to array
>>
>> Are you using debugging? Try to use E_ALL ^ E_NOTICE as the
>> current Smarty releases will often produce notices.
>>
>> I think following produces a notice, too:
>>
>> {$unset|default:'Variable unset is not set'}
The following patch to Smarty_Compiler.class.php fixes this problem but
at a performance cost as it will be doing lots of isset calls.
--- Smarty_Compiler.class.php.org Sat Jul 13 13:06:11 2002
+++ Smarty_Compiler.class.php Sat Jul 13 13:07:55 2002
@@ -1140,6 +1140,7 @@
}
} else {
$output = "\$this->_tpl_vars['$var_name']";
+ $output = "!isset($output) ? NULL : $output";
}
foreach ($indexes as $index) {
--
Joakim Andersson ; tyrak@borgship.net ; http://borgship.net/~tyrak/