Re: [PHP] what's the difference in the following code?

2008-10-25 Thread Chris Shiflett
On Oct 23, 2008, at 2:10 PM, Jochem Maas wrote: The order is reversed, so if $host has a non-zero length, it is not escaped. first thing that I noticed, second wondering why no charset was specified, thirdly was wondering why it's not plain: $host = htmlentities($host); but nonetheless

Re: [PHP] what's the difference in the following code?

2008-10-24 Thread Yeti
The difference between the examples are still nothing, it do the same. But I never use the short version of if, because when I look after some month in some projects I have a better overview when there is a long if , its much easier to extend. As explained a couple of times already - there is

Re: [PHP] what's the difference in the following code?

2008-10-23 Thread Chris Shiflett
On Oct 17, 2008, at 1:58 PM, Lamp Lists wrote: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good: $search = ''; if

Re: [PHP] what's the difference in the following code?

2008-10-23 Thread Robert Cummings
On Thu, 2008-10-23 at 11:00 -0400, Chris Shiflett wrote: On Oct 17, 2008, at 1:58 PM, Lamp Lists wrote: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ?

Re: [PHP] what's the difference in the following code?

2008-10-23 Thread tedd
At 11:00 AM -0400 10/23/08, Chris Shiflett wrote: On Oct 17, 2008, at 1:58 PM, Lamp Lists wrote: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : '';

Re: [PHP] what's the difference in the following code?

2008-10-23 Thread Jochem Maas
Chris Shiflett schreef: On Oct 17, 2008, at 1:58 PM, Lamp Lists wrote: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good:

Re: [PHP] what's the difference in the following code?

2008-10-23 Thread Thomas Wicht
On Oct 17, 2008, at 1:58 PM, Lamp Lists wrote: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good: $search = ''; if

Re: [PHP] what's the difference in the following code?

2008-10-21 Thread Yeti
OP = original poster (in this case I guess) http://acronyms.thefreedictionary.com/OP So it's all about making code readable and probably easier to maintain (even people unfamiliar with the script). Doesn't that render the ternary operator IF-statement unnecessary? Have I been totally wrong using

Re: [PHP] what's the difference in the following code?

2008-10-21 Thread Jochem Maas
tedd schreef: At 6:37 AM -0700 10/20/08, Lamp Lists wrote: - Original Message From: tedd [EMAIL PROTECTED] To: Lamp Lists [EMAIL PROTECTED]; php-general@lists.php.net Sent: Monday, October 20, 2008 8:25:50 AM Subject: Re: [PHP] what's the difference in the following code? At 10

Re: [PHP] what's the difference in the following code?

2008-10-21 Thread tedd
At 2:44 AM -0700 10/21/08, Yeti wrote: Somebody please tell me that I do not have to rewrite my code base now, since I care about security. You do not have to rewrite your code because you use ternary operators! Nobody said that. Again, Chris was not saying that it was the use of the

Re: [PHP] what's the difference in the following code?

2008-10-20 Thread tedd
At 10:58 AM -0700 10/17/08, Lamp Lists wrote: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good: $search = ''; if

Re: [PHP] what's the difference in the following code?

2008-10-20 Thread Lamp Lists
- Original Message From: tedd [EMAIL PROTECTED] To: Lamp Lists [EMAIL PROTECTED]; php-general@lists.php.net Sent: Monday, October 20, 2008 8:25:50 AM Subject: Re: [PHP] what's the difference in the following code? At 10:58 AM -0700 10/17/08, Lamp Lists wrote: I'm reading Essential PHP

Re: [PHP] what's the difference in the following code?

2008-10-20 Thread tedd
At 6:37 AM -0700 10/20/08, Lamp Lists wrote: - Original Message From: tedd [EMAIL PROTECTED] To: Lamp Lists [EMAIL PROTECTED]; php-general@lists.php.net Sent: Monday, October 20, 2008 8:25:50 AM Subject: Re: [PHP] what's the difference in the following code? At 10:58 AM -0700 10/17/08

Re: [PHP] what's the difference in the following code?

2008-10-20 Thread Daniel Brown
On Mon, Oct 20, 2008 at 10:02 AM, tedd [EMAIL PROTECTED] wrote: I hate it when people take things out of context and misquote others. Chris did not say that one way was better, or different, than the other. But rather he used two sets of code to illustrate a point. Welcome back, Grum-pa.

Re: [PHP] what's the difference in the following code?

2008-10-20 Thread tedd
At 10:12 AM -0400 10/20/08, Daniel Brown wrote: On Mon, Oct 20, 2008 at 10:02 AM, tedd [EMAIL PROTECTED] wrote: I hate it when people take things out of context and misquote others. Chris did not say that one way was better, or different, than the other. But rather he used two sets of code

Re: [PHP] what's the difference in the following code?

2008-10-20 Thread Lamp Lists
- Original Message From: tedd [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, October 20, 2008 4:15:02 PM Subject: Re: [PHP] what's the difference in the following code? At 10:12 AM -0400 10/20/08, Daniel Brown wrote: On Mon, Oct 20, 2008 at 10:02 AM, tedd [EMAIL

Re: [PHP] what's the difference in the following code?

2008-10-18 Thread Dotan Cohen
2008/10/17 Lamp Lists [EMAIL PROTECTED]: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good: $search = ''; if

[PHP] what's the difference in the following code?

2008-10-17 Thread Lamp Lists
I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good: $search = ''; if (isset($_GET['search'])) { $search = $_GET['search']; }

Re: [PHP] what's the difference in the following code?

2008-10-17 Thread Richard Heyes
I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good: $search = ''; if (isset($_GET['search'])) { $search = $_GET['search'];

Re: [PHP] what's the difference in the following code?

2008-10-17 Thread Eric Butera
On Fri, Oct 17, 2008 at 1:58 PM, Lamp Lists [EMAIL PROTECTED] wrote: I'm reading Essential PHP Security by Chris Shiflett. on the very beginning, page 5 6, if I got it correct, he said this is not good: $search = isset($_GET['search']) ? $_GET['search'] : ''; and this is good: $search