Error in OS/Guess.php of newly released PEAR 1.2
| From: | marko | Date: | Mon, 18 Aug 2003 07:22:28 +0000 |
| Subject: | Error in OS/Guess.php of newly released PEAR 1.2 | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7265@lists.php.net to get a copy of this message | ||
Hi PEAR crew,
with the latest PEAR 1.2 I got odd behaviour on my SuSE 7.3 with
self-compiled PHP:
***
PHP 4.3.2-RC1 (cli) (built: May 4 2003 21:56:03)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
with the ionCube PHP Accelerator v1.3.3r2, Copyright (c) 2001-2002, by Nick Lindridge
***
Look here:
------------------------------------------------------------------------------
idefix:~ # pear upgrade-all
Release Warnings
================
w
w
downloading PEAR-1.2.tgz ...
...done: 83,109 bytes
Notice: Undefined offset: 1 in Guess.php on line 173
Warning: readlink() [http://www.php.net/function.readlink]: Invalid
argument in Guess.php on line 181
upgrade-all ok: PEAR 1.2
------------------------------------------------------------------------------
The first offset thing is connected to the fact that the algorithm lets
empty lines pass. Would be good to catch that via
if ($line{0} == '#' || trim($line) == '')
and the second problem is connected to a use of readlink() without
checking its return value(which is FALSE in my case). I wondered why, but
it is because my "/lib/libc.so.6" is a regular file and not a symbolic
link. This should be checked properly to avoid the problem! Or did I miss
something else, since on a different system with SuSE 8.2 the error didn't
occur... :|
Bye,
Marko