php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #145 Problems with variables that seem integer
Submitted: 1998-03-04 14:37 UTC Modified: 1998-03-05 11:21 UTC
From: melo at co dot telenet dot pt Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0b3 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: melo at co dot telenet dot pt
New email:
PHP Version: OS:

 

 [1998-03-04 14:37 UTC] melo at co dot telenet dot pt
First, it's not a crash, but it is reproducable... 

Try this:
<html>
<body>
<? if ($a) { echo "<h1>$a</h1>"; } ?>
<form method=post>
  insert a big number here (12 digits beginning with a 5 or bigger):
  <input type="text" name="a" value="<?echo $a?>">
  <input type="submit" name="test" value="Test!">
</form>
</body>
</html>

Try it with 1234567890 and 12345678901
The second value prints 2147483647
It's a overflow problem.
I think that php should treat webinput as strings until
the variable is used.
I'm assuming that php tries to guess the variable type

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-05 11:21 UTC] zeev
Turns out beta 1 was used.
beta 3 or always set the type of form variables as string.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC