Sec Bug->Bug #78865 [Opn->Nab]: Does not check information from the "GET data" correctly
| From: | cmb@php.net | Date: | Sat, 23 Nov 2019 12:46:35 +0000 |
| Subject: | Sec Bug->Bug #78865 [Opn->Nab]: Does not check information from the "GET data" correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223871@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78865&edit=1
ID: 78865
Updated by: cmb@php.net
Reported by: facemxd at hotmail dot com
Summary: Does not check information from the "GET data"
correctly
-Status: Open
+Status: Not a bug
-Type: Security
+Type: Bug
Package: *Regular Expressions
Operating System: windows 10 x64
PHP Version: 7.3.12
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: Y
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
For a start, do
var_dump($_GET['number']);
Previous Comments:
------------------------------------------------------------------------
[2019-11-23 12:34:59] facemxd at hotmail dot com
Description:
------------
hi PHP
I write a function. only numbers turn true. but it returns true when you get parameter add the #
character
test.php file code :
why does it give such an error? I just detected the # character.
please help me, what is the problem?. have a nice day :)
testing info : XAMPP & PHP 7.3.1 & x64 win10 & chrome 78
Test script:
---------------
// test.php
function number_is_valid($get_data){
return ( preg_match('/[^0-9]/', $get_data) ) ? "NO" : "YES";
}
$data = $_GET['number'];
$result = number_is_valid($data);
print_r($result);
Testing results :
test.php?number=a4
// result NO
test.php?number=4
// result YES
test.php?number=4#
// result YES
test.php?number=4#@#
// result YES
but no problem with data from variable
$data = "4#";
$result = number_is_valid($data);
// result NO
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78865&edit=1