php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71019 preg_match length
Submitted: 2015-12-03 20:22 UTC Modified: 2015-12-03 22:40 UTC
From: nospam4me at diamantnetz dot de Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.6.16 OS: Linux Ubuntu
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nospam4me at diamantnetz dot de
New email:
PHP Version: OS:

 

 [2015-12-03 20:22 UTC] nospam4me at diamantnetz dot de
Description:
------------
1. input one or more of the german äÄöÖüÜß in a html form 30 times (= max length)
2. Submit $_POST['passwort']
3. You get an error ("Fehler")

The same with i.E. 30 digits or a-Z doesnt produce an error.

An input of german äÄöÖüÜß less then 30 times doesnt produce an error.

A really not so nice fault ;-)

Perhaps the fault is corresponding with utf-8

Test script:
---------------
header("Content-Type: text/html; charset=utf-8");
if( (!@(preg_match('/^[0-9a-zA-ZäÄöÖüÜß&?!%@#,\.:_=+-]{1,30}$/',$_POST['passwort']))) ) echo 'Fehler';


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-03 22:40 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Scripting Engine problem +Package: PCRE related
 [2015-12-03 22:40 UTC] requinix@php.net
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.

You must use the /u flag in your regex if you want UTF-8 support.
http://php.net/manual/en/reference.pcre.pattern.modifiers.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC