Re: [PHPLIB] phpinfo() dumps core only with phplib page_open in place From: Brian S. Craigie (Brian.Craigie <email protected>)
Date: 01/05/00

I managed to fix the warning about $sid by putting

>>> if (!IsSet($id)) { $id = ""; }

before line 96 in session.inc:

>>> if ( "" == $id ) {

However, I can't see why the function definition :

>>> function get_id($id = "") {

should not have set what appears to be a default value for $id.

Anyway, having removed that warning, I now get a warning. Bad Escape Sequence:
\' in session.inc on line 267
which reads:-

>>> case "array":
>>> ## $$prefix is an array. Enumerate the elements and serialize them.

>>> eval("reset(\$$prefix); \$l =
gettype(list(\$k)=each(\$$prefix));");
>>> $str .= "\$$prefix = array(); ";
>>> while ( "array" == $l ) {
>>> ## Structural recursion
>>> $this->serialize($prefix."['".ereg_replace("([\\\'])", "\\\\1",
$k)."']", &$str); # <-- line 267
>>> eval("\$l = gettype(list(\$k)=each(\$$prefix));");
>>> }

As far as I can tell, it's trying to put an extra \ before either a \ or a ',
hmm... Last time I saw that error was on an old version of php3. The comment
at the top of this code section says "## You don't need to know..." -- I can
see why!

Any ideas what this should be? Obviously it's nothing too serious or phplib
wouldn't be working, but the fact that something isn't quite right worries me
that it might come back and bite me.

Best regards and thanks again,

Brian

"Brian S. Craigie" wrote:

> Hi,
>
> I'm using php 3.0.12 and phplib-7.2 downloaded today (on Solaris 7)

> [snip]

> The second issue is more related to phplib. With warning level set at
> 15, there are warnings about uninitialized variable $sid in line 396 of
> session.inc and on line 96 of the same file. Because of the warnings,
> the cookies can't be set, so it doesn't work properly. If I set the
> warning level to 7, the demo pages work OK (except the phpinfo one).
> Has anyone fixed this minor bug and want to share it with me please?
>
> TIA
>
> Brian

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.