issues comparing email with webmaster_email |
|||
|---|---|---|---|
| Date: | 03/15/2010 | Show-stopper?: | |
| Status: | See Comments | Reporter: | D. Shun-Luoi Fong |
| Reported in Version: | 2.0.1PB 20100215 | Assigned To: | Not Assigned |
| Keywords: | Errors, PHP, | ||
| Support Thread: | |||
Details
When comparing the
{email}
{webmaster_email}
variable, two different issues arise:
1. If the two variables are compared in an if statement, a right curly bracket “}” is output as html
2. If the two variables are compared in an if statement, the statement always resolves as true (or false depending on the order of the comparison).
3. If the variables are wrapped in quotes, a PHP error is thrown.
Please see the following URL for further description of the issue:
Comment on Bug Report
| Posted by: Greg Aker on 25 March 2010 4:42pm | |
|
|
[ Permalink ]
webmaster_email is a global variable, and not meant to be used in this way. Please see: http://expressionengine.com/docs/templates/globals/conditionals.html and: http://expressionengine.com/docs/templates/globals/single_variables.html Thanks |
| Posted by: D. Shun-Luoi Fong on 26 March 2010 7:47am | |
|
|
[ Permalink ]
Hi Greg, I read through both links to which you referred, and I’m not seeing where it says you can’t use webmaster_email in a conditional, and why. Sorry if I’m missing it… In the conditionals doc, I see where they use the ‘username’ global variable in a conditional, e.g. {if username == “elvira”}, although in the example username is being compared to a string rather than another variable. Is the issue that you can’t compare webmaster_email to another variable, or you can’t use webmaster_email in a conditional at all? I guess I’m not understanding why webmaster_email is “not meant to be used in this way.” |
