|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78865 Does not check information from the "GET data" correctly
Submitted: 2019-11-23 12:34 UTC Modified: 2019-11-23 12:46 UTC
From: facemxd at hotmail dot com Assigned: cmb (profile)
Status: Not a bug Package: *Regular Expressions
PHP Version: 7.3.12 OS: windows 10 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: facemxd at hotmail dot com
New email:
PHP Version: OS:


 [2019-11-23 12:34 UTC] facemxd at hotmail dot com
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);

Testing results :

// result NO
// result YES
// result YES
// result YES
but no problem with data from variable
$data = "4#";
$result = number_is_valid($data);
// result NO


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-11-23 12:46 UTC]
-Status: Open +Status: Not a bug -Type: Security +Type: Bug -Assigned To: +Assigned To: cmb
 [2019-11-23 12:46 UTC]
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 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

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 23:01:28 2024 UTC