Have I been staring at the screen too long? [message #181013] |
Sat, 06 April 2013 01:20 |
Richard Yates
Messages: 86 Registered: September 2013
Karma: 0
|
Member |
|
|
I ran across this line that is apparently generated by Dreamweaver
CS4's function for checking authorization for page access. Doesn't the
content of the 'if' clause ALWAYS evaluate to false regardless of the
value of $strUsers?
if (($strUsers == "") && false) { $isValid = true; }
If so, is there some obscure purpose anyone can think of for this
line?
Richard Yates
|
|
|
Re: Have I been staring at the screen too long? [message #181014 is a reply to message #181013] |
Sat, 06 April 2013 02:04 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/5/2013 9:20 PM, Richard Yates wrote:
> I ran across this line that is apparently generated by Dreamweaver
> CS4's function for checking authorization for page access. Doesn't the
> content of the 'if' clause ALWAYS evaluate to false regardless of the
> value of $strUsers?
>
> if (($strUsers == "") && false) { $isValid = true; }
>
> If so, is there some obscure purpose anyone can think of for this
> line?
>
> Richard Yates
>
Another good reason not to use Dreamweaver.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Have I been staring at the screen too long? [message #181015 is a reply to message #181013] |
Sat, 06 April 2013 13:22 |
Scott Johnson
Messages: 196 Registered: January 2012
Karma: 0
|
Senior Member |
|
|
On 4/5/2013 6:20 PM, Richard Yates wrote:
> I ran across this line that is apparently generated by Dreamweaver
> CS4's function for checking authorization for page access. Doesn't the
> content of the 'if' clause ALWAYS evaluate to false regardless of the
> value of $strUsers?
>
> if (($strUsers == "") && false) { $isValid = true; }
>
> If so, is there some obscure purpose anyone can think of for this
> line?
>
> Richard Yates
>
At first glance it looks like it is taking something that would
otherwise be false and making evaluate to true.
|
|
|
Re: Have I been staring at the screen too long? [message #181016 is a reply to message #181013] |
Sat, 06 April 2013 15:50 |
M. Strobel
Messages: 386 Registered: December 2011
Karma: 0
|
Senior Member |
|
|
Am 06.04.2013 03:20, schrieb Richard Yates:
> I ran across this line that is apparently generated by Dreamweaver
> CS4's function for checking authorization for page access. Doesn't the
> content of the 'if' clause ALWAYS evaluate to false regardless of the
> value of $strUsers?
>
> if (($strUsers == "") && false) { $isValid = true; }
>
> If so, is there some obscure purpose anyone can think of for this
> line?
Yes, ($b && false) is always false, ($b || false) is always $b.
/Str.
|
|
|
Re: Have I been staring at the screen too long? [message #181017 is a reply to message #181016] |
Sat, 06 April 2013 16:27 |
Scott Johnson
Messages: 196 Registered: January 2012
Karma: 0
|
Senior Member |
|
|
On 4/6/2013 8:50 AM, M. Strobel wrote:
> Am 06.04.2013 03:20, schrieb Richard Yates:
>> I ran across this line that is apparently generated by Dreamweaver
>> CS4's function for checking authorization for page access. Doesn't the
>> content of the 'if' clause ALWAYS evaluate to false regardless of the
>> value of $strUsers?
>>
>> if (($strUsers == "") && false) { $isValid = true; }
>>
>> If so, is there some obscure purpose anyone can think of for this
>> line?
>
> Yes, ($b && false) is always false, ($b || false) is always $b.
>
> /Str.
>
Certainly right. Now that I look at the logical operator, it will
always be false no matter the comparison and the if statement will never
be executed.
Strange code.
Scotty
|
|
|
|
Re: Have I been staring at the screen too long? [message #181025 is a reply to message #181017] |
Sat, 06 April 2013 18:58 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 06/04/13 17:27, Scott Johnson wrote:
> On 4/6/2013 8:50 AM, M. Strobel wrote:
>> Am 06.04.2013 03:20, schrieb Richard Yates:
>>> I ran across this line that is apparently generated by Dreamweaver
>>> CS4's function for checking authorization for page access. Doesn't the
>>> content of the 'if' clause ALWAYS evaluate to false regardless of the
>>> value of $strUsers?
>>>
>>> if (($strUsers == "") && false) { $isValid = true; }
>>>
>>> If so, is there some obscure purpose anyone can think of for this
>>> line?
>>
>> Yes, ($b && false) is always false, ($b || false) is always $b.
>>
>> /Str.
>>
>
> Certainly right. Now that I look at the logical operator, it will
> always be false no matter the comparison and the if statement will never
> be executed.
>
> Strange code.
>
according to the link posted abobe, its so the false can be toggled to
rue easily by Dreamweaver.
I spent two days turning dreamweaver code into respectable HTML, got it
down from 40k to 3k..
> Scotty
>
>
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
|
|
|
Re: Have I been staring at the screen too long? [message #181027 is a reply to message #181025] |
Sat, 06 April 2013 22:02 |
Scott Johnson
Messages: 196 Registered: January 2012
Karma: 0
|
Senior Member |
|
|
On 4/6/2013 11:58 AM, The Natural Philosopher wrote:
> On 06/04/13 17:27, Scott Johnson wrote:
>> On 4/6/2013 8:50 AM, M. Strobel wrote:
>>> Am 06.04.2013 03:20, schrieb Richard Yates:
>>>> I ran across this line that is apparently generated by Dreamweaver
>>>> CS4's function for checking authorization for page access. Doesn't the
>>>> content of the 'if' clause ALWAYS evaluate to false regardless of the
>>>> value of $strUsers?
>>>>
>>>> if (($strUsers == "") && false) { $isValid = true; }
>>>>
>>>> If so, is there some obscure purpose anyone can think of for this
>>>> line?
>>>
>>> Yes, ($b && false) is always false, ($b || false) is always $b.
>>>
>>> /Str.
>>>
>>
>> Certainly right. Now that I look at the logical operator, it will
>> always be false no matter the comparison and the if statement will never
>> be executed.
>>
>> Strange code.
>>
>
> according to the link posted abobe, its so the false can be toggled to
> rue easily by Dreamweaver.
>
> I spent two days turning dreamweaver code into respectable HTML, got it
> down from 40k to 3k..
>
>
>> Scotty
>>
>>
>
>
I think you are right, DW used many coding 'wizards' with several options.
Yeah I remember using DW when Macromedia had it and it did add a great
deal of 'one size fits all' coding.
|
|
|
Re: Have I been staring at the screen too long? [message #181084 is a reply to message #181013] |
Thu, 11 April 2013 10:57 |
mirceatanasie94
Messages: 1 Registered: April 2013
Karma: 0
|
Junior Member |
|
|
Il giorno sabato 6 aprile 2013 03:20:00 UTC+2, Richard Yates ha scritto:
> I ran across this line that is apparently generated by Dreamweaver
>
> CS4's function for checking authorization for page access. Doesn't the
>
> content of the 'if' clause ALWAYS evaluate to false regardless of the
>
> value of $strUsers?
>
>
>
> if (($strUsers == "") && false) { $isValid = true; }
>
>
>
> If so, is there some obscure purpose anyone can think of for this
>
> line?
>
>
>
> Richard Yates
|
|
|