Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » General Discussions » General Discussion » New PHPBB exploit out...don't bother trying it here
New PHPBB exploit out...don't bother trying it here [message #142118] Sat, 05 March 2005 22:12 Go to previous messageGo to next message
spreegem is currently offline  spreegem
Messages: 1755
Registered: March 2003
Location: Ellington, CT
Karma: 0
General (1 Star)

The PHP book I got here says. . .
= means equals
== means is equal to
=== means identical to
New PHPBB exploit out...don't bother trying it here [message #142135] Sun, 06 March 2005 02:08 Go to previous messageGo to next message
Crimson is currently offline  Crimson
Messages: 7427
Registered: February 2003
Location: Phoenix, AZ
Karma: 0
General (5 Stars)
ADMINISTRATOR
Laeubi

IRON FART

"==" means equal.
"===" means equal to and same type.

http://www.php.net/manual/en/language.operators.comparison.php

Right for example you can compare a number and a string like:

if ("a"==0) woudl return true, because a string is converted to zero by default if it don't conatain ana number at the start, but
if ("a"===0) would return false, because String is not Int Wink


That's not quite true, because PHP does automatic type switching in the case of "==" so the 0 integer would automatically be converted to a string of "0" and be false. Using "===" would prevent PHP from changing the integer to a string.


I'm the bawss.
New PHPBB exploit out...don't bother trying it here [message #142151] Sun, 06 March 2005 07:20 Go to previous messageGo to next message
Rapollo is currently offline  Rapollo
Messages: 7
Registered: January 2005
Location: United Kingdom
Karma: 0
Recruit
I am crap at php but if I am not mistaken, like spreegem said:
doesnt == represent equal to and === represent identical to, so ("a" == 0) would return false would it not? Like I said I am crap at php.

But back on topic, like j_ball:
vB owns all!
New PHPBB exploit out...don't bother trying it here [message #142186] Sun, 06 March 2005 09:01 Go to previous messageGo to next message
snipesimo is currently offline  snipesimo
Messages: 764
Registered: February 2003
Karma: 0
Colonel
in mIRC scripting, === is the same as == only === means case sensitive match.
New PHPBB exploit out...don't bother trying it here [message #142268] Sun, 06 March 2005 15:37 Go to previous messageGo to next message
Deactivated is currently offline  Deactivated
Messages: 1503
Registered: February 2003
Karma: 0
General (1 Star)
Rapollo

But back on topic, like j_ball:
vB owns all!


vB owns one's wallet.
New PHPBB exploit out...don't bother trying it here [message #142284] Sun, 06 March 2005 17:01 Go to previous messageGo to next message
flyingfox is currently offline  flyingfox
Messages: 1612
Registered: February 2003
Location: scotland, uk
Karma: 0
General (1 Star)
But couldn't you turn on 'option strict' (dunno what it is in php) to prevent the convertion from integer to string??

Quote:

PHP does automatic type switching in the case of "==" so the 0 integer would automatically be converted to a string of "0" and be false.
New PHPBB exploit out...don't bother trying it here [message #142287] Sun, 06 March 2005 17:21 Go to previous messageGo to next message
Crimson is currently offline  Crimson
Messages: 7427
Registered: February 2003
Location: Phoenix, AZ
Karma: 0
General (5 Stars)
ADMINISTRATOR
http://us2.php.net/manual/en/language.operators.comparison.php

$a == $b Equal TRUE if $a is equal to $b.
$a === $b Identical TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)

If you compare an integer with a string, the string is converted to a number. If you compare two numerical strings, they are compared as integers.

Automatic Type Juggling

I have been coding PHP for 5 years, I know what I'm talking about.


I'm the bawss.
New PHPBB exploit out...don't bother trying it here [message #142292] Sun, 06 March 2005 17:38 Go to previous messageGo to next message
flyingfox is currently offline  flyingfox
Messages: 1612
Registered: February 2003
Location: scotland, uk
Karma: 0
General (1 Star)
I read & understood most of it...so in conclusion, you can juggle between data types in PHP but you can't prevent PHP from automatic juggling (converting)? All I was asking really, as in visual basic you can stop automatic conversions using option strict on to gain more control over what's happening in the code
New PHPBB exploit out...don't bother trying it here [message #142293] Sun, 06 March 2005 17:39 Go to previous message
Crimson is currently offline  Crimson
Messages: 7427
Registered: February 2003
Location: Phoenix, AZ
Karma: 0
General (5 Stars)
ADMINISTRATOR
I think that's what === is for. Razz

I'm the bawss.
Previous Topic: HL2 Ren mod
Next Topic: Can you place it? Completed
Goto Forum:
  


Current Time: Mon May 06 23:18:10 MST 2024

Total time taken to generate the page: 0.00856 seconds