|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14989 eregi function causes problem in include file
Submitted: 2002-01-10 22:10 UTC Modified: 2002-02-02 06:35 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: nonzero at bigfoot dot com Assigned:
Status: No Feedback Package: Regexps related
PHP Version: 4.1.0 OS: FreeBSD 4.4-RELEASE
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: nonzero at bigfoot dot com
New email:
PHP Version: OS:


 [2002-01-10 22:10 UTC] nonzero at bigfoot dot com
have a web ap with an include file called common.php that contains:
// Database Initialize
$db = new DB_Sql();

eregi must be outputing some data to the server since the page that includes the above include file returns an error:
(note that line 22 is the first eregi expression in common.php)

=======error message begin:
Warning: REG_EMPTY in /usr/local/home/vhosts/ on line 22

Warning: Cannot send session cache limiter - headers already sent (output started at /usr/local/home/vhosts/ in /usr/local/home/vhosts/ on line 16
=======error message end:

infoGrid.php is setting cookies
removing the eregi test and replacing the above lines in common.php with:

removes the error

It seems to me that eregi must be outputing something back to the server.

I couldn't find this bug in the bug database so I'd appreciate it if anyone has time to look into it.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-10 23:34 UTC]
This basically means that the regexp passed to eregi() is empty, i.e. that $HOSTNAME has no value (I guess its null then).

Somehow your code looks bogus:
if (eregi($HOSTNAME, "....

would imply that $HOSTNAME actualyl is a regular expression. Are you sure about this?

If you just want to match if two strings are similar you should use

if ($HOSTNAME == "www..

You can surpress warning output with the '@' operator, e.g. @eregi().

 [2002-01-11 00:05 UTC] nonzero at bigfoot dot com
$HOSTNAME is not null, it is = to the server name. The same eregi code works fine without errors in php v 4.06 on mandrake linux v 8.1. Therefore I do believe this is a valid bug. Additinally, when I echo $HOSTNAME in infoGrid.php, it is indeed equal to the server hostname.

 [2002-01-11 02:37 UTC]
Then please provide a self-contained example which doesn't use variables but direct values passed to eregi() which we can reconstruct.
 [2002-02-02 06:35 UTC]
No feedback was provided for this bug, so it is being suspended.
If you are able to provide the information that was requested,
please do so and change the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 10:01:29 2024 UTC