php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39646 preg_match not working over https with delcared array
Submitted: 2006-11-27 16:47 UTC Modified: 2010-01-28 04:38 UTC
From: noreply at test dot com Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 5.2.0 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: noreply at test dot com
New email:
PHP Version: OS:

 

 [2006-11-27 16:47 UTC] noreply at test dot com
Description:
------------
Very oddly, preg_match does not seem to work in some cases over https:// while it works fine over http://

See:
https://208.97.159.12/test.php (doesn't work) vs.
http://208.97.159.12/test.php (does work).

Only occurs when array is declared implicitely in function, e.g. preg_match($pat, $class, $mat=array()) does not work on  https:// while preg_match($pat, $class, $mat) works on both https:// and http://







Reproduce code:
---------------
<? $class="C11"; ?>
<?
$pat = '/^(\D+)(\d+)$/';
if (!preg_match($pat, $class, $mat=array())) {
$notdigits='';
$digits = '';
} else {
print_r($mat);
}  
?>

Expected result:
----------------
Array ( [0] => C11 [1] => C [2] => 11 )

Actual result:
--------------
Array ( )

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-27 17:21 UTC] tony2001@php.net
preg_match() knows nothing about HTTP or HTTPS, there must be something else, that affect this behaviour (different data, for example).
 [2010-01-28 04:38 UTC] noreply at test dot com
Changing email.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 11 11:01:27 2024 UTC