Re: [SMARTY] Global HTTP_IF_MODIFIED_SINCE undefined
| From: | Roman Neuhauser | Date: | Wed, 14 Aug 2002 14:23:38 +0000 |
| Subject: | Re: [SMARTY] Global HTTP_IF_MODIFIED_SINCE undefined | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5701@lists.php.net to get a copy of this message | ||
> Date: Wed, 14 Aug 2002 16:11:39 +0200
> From: Mats-Olof Sander <moj@alertir.com>
> To: smarty-general@lists.php.net
> Subject: [SMARTY] Global HTTP_IF_MODIFIED_SINCE undefined
>
> When the global var HTTP_IF_MODIFIED_SINCE is undefined I get an error
> message from Smarty->fetch.
>
> I can get rid of the message if I put a '@' before the expression using the
> variable, but I don't know if that has any side effects. Can someone
> enlighten me?
>
> The changed line in Smarty is:
> $last_modified_date =
> @substr($GLOBALS['HTTP_SERVER_VARS']['HTTP_IF_MODIFIED_SINCE'], 0,
> strpos($GLOBALS['HTTP_SERVER_VARS']['HTTP_IF_MODIFIED_SINCE'],
> 'GMT') + 3);
you can wrap that line in a check for the variable's existance, or,
if you don't mind sloppy hacks, just leave the @ in. no side
effects, just that it doesn't actually improve code readability. the
at sign silences *all* errors, not just this one.
--
FreeBSD 4.6-STABLE
4:21PM up 5 days, 4:16, 17 users, load averages: 0.06, 0.03, 0.01