Bug #11520: Same eregi() script, different OS's, different results
| From: | child_god at yahoo dot com | Date: | Sun, 17 Jun 2001 15:30:46 +0000 |
| Subject: | Bug #11520: Same eregi() script, different OS's, different results | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-56787@lists.php.net to get a copy of this message | ||
From: child_god@yahoo.com
Operating system: Win NT 4.0sp6a/Win2k Server/RedHat Linux 7.1
PHP version: 4.0.4pl1
PHP Bug Type: *Regular Expressions
Bug description: Same eregi() script, different OS's, different results
This script from www.4cm.com works on Win NT 4.0sp6a and Win 2k Server without any problem, but
fails on two different Red Hat Linux 7.1 machines. One 7.1 machine is a Dell 166mhz with a 48mb of
ram, the other is a Dell P3 600mhz with 384mb of ram. All machines are using php 4.0.4pl1. The red
hat machines installed php at install time, server class installation, no mod_php installed (at
least that's what rpm -qi mod_php said). Apache is compiled with mod_so.c
<?php
###############################################################
# Script Title: 4CM_Grabber
# File: 4CM_Grabber.php
# Description: This script will Grab information from a given web site
# Author: John B. Abela
# Email: support@4cm.com
# Web: http://www.4cm.com/
# Version: 2.0.5
#
# Copyright © 1996-2000 www.4cm.com. All Rights Reserved.
#
#
# www.4cm.com (4CM) offers no warranties on this script.
# The downloader of the script is solely responsible for any
# problems caused by the installation of the script or use
# of the script, including possible legal action for the grabbing
# of the data, as a result of this script!
#
# ALL COPYRIGHT NOTICES REGARDING: www.4cm.com
# MUST REMAIN INTACT IN THE SCRIPT AND IN THE HTML OF THE SCRIPT!
#
# For more info on this script, see:
# http://www.4cm.com/
#
# (Please be kind and sign our guestbook at:
# http://www.4cm.com/guestbook/ and say your using
# this script!!)
###############################################################
########################
## Mandatory Setting ##
########################
$GrabURL = "http://www.theregister.co.uk"; //- Complete
URL Of The Page Your Grabbing From!
$GrabStart = "<!-- </td></Tr> -->"; //- HTML Code To Start Grab. Must
Be A Unique Bit Of Code!
$GrabEnd = "<IMG SRC=\'/Themes/Normal/Sections.gif\' ALT=\'Sections\'
BORDER=\'0\' WIDTH=\'150\' HEIGHT=\'15\'>"; //- HTML Code To
End Grab. Must Be A Unique Bit Of Code!
#############################
## Do Not Edit Below Here ##
## Do Not Edit Below Here ##
#############################
$OpenFile = fopen("$GrabURL", "r"); //- DO NOT CHANGE
$RetrieveFile = fread($OpenFile, 200000); //- Reduce This To Save Memory
$GrabData = eregi("$GrabStart(.*)$GrabEnd", $RetrieveFile, $DataPrint);
// $DataPrint[1] = str_replace("", "", $DataPrint[1]); //- Un-Comment This
Line for "Replace" purposes!
// $DataPrint[1] = str_replace("", "", $DataPrint[1]); //- Un-Comment This
Line for "Replace" purposes!
fclose($OpenFile); //- DO NOT CHANGE
echo $DataPrint[1]; //- DO NOT CHANGE
####################
## End of Script ##
####################
?>
If i change the $GrabData = eregi(... line to
$GrabData = eregi("$GrabStart(.*)", ... basically taking out the $GrabEnd, the script
works. If i replace $GrabStart with $GrabEnd, the script works.
BUT, it will not work if I have both in the expression (on the Red Hat Linux 7.1 machines).
Why?
--
Edit Bug report at: http://bugs.php.net/?id=11520&edit=1