The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Here's the problem.
PHP Code:
Thanks. - Dan |
#2
|
||||
|
||||
![]()
might it be that it has something to do with the regional settings, meaning that he used to interpret the dot (.) as a character, making it not a valid integer, but now interprets it as the kind of dot between the number and the decimal digits (which would mean it's a valid integer)
|
#3
|
|||
|
|||
![]()
No that's not it. The region hasn't changed.
123.123 does not equal intval(123.123) because intval(123.123) equals 123 so it's doing that much correctly. What it's not doing is Echoing the 0. |
#4
|
|||
|
|||
![]()
Another example of broken code from this behaviour is the vB 2.2.x update threads routine in /admin/misc.php if there are no attachments for a particular thread,
$attachsum= instead of $attachsum=0 |
#5
|
||||
|
||||
![]()
actually == should return a boolean value, ie true or false and not 1 or 0.
|
#6
|
|||
|
|||
![]()
Thanks Xenon.
That's fair enough but if you try it yourself, you'll see that you get an output of 1 when it's true. What about the 2nd example? |
#7
|
||||
|
||||
![]()
Hmm, very wierd, maybe they choosed a behaviour like that to make it easier in comparisons.
so 1 will be true in every condition, and false will have an empty string as output, so it will always result in a false. actually to get the 0-1 way, just use intval($val==intval($val)); that should return what you want. edit: vb2.2 isn't compatible to the newest default settings of php, as php doesn't interpolate that much as php4 does. so you need a better coding to run things in php5. Some settings can be set so it acts like php4 in a lot of ways, but not on every aspect i think. |
#8
|
|||
|
|||
![]() Quote:
|
#9
|
|||
|
|||
![]() Quote:
Quote:
|
#10
|
||||
|
||||
![]()
just as i expected..
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|