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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 - 9 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 16:01:29 2024 UTC