Page 1 of 1

Bug inside serendipity_query_default function.

Posted: Fri Apr 22, 2005 11:54 pm
by BobRock
Following fragment of code does not work correctly on a Windows system, problem is that on a Windows system directories inside path variable are separated by ";" and not by ":".

Code: Select all

            if (isset($_SERVER['PATH'])) {
                $path = array_merge($path, explode(':', $_SERVER['PATH']));
            }
Fix:

Code: Select all

            if (isset($_SERVER['PATH'])) {
                $path = array_merge($path, explode(';', $_SERVER['PATH']));
            }
There is a also hang somewhere inside following expression on my system when a directory is an empty string.

Code: Select all

                if ((function_exists('is_executable') && is_executable($dir . '/convert')) || is_file($dir . '/convert')) {
Fix:

Code: Select all

              if (strlen($dir)>0 && ((function_exists('is_executable') && is_executable($dir . '/convert')) || is_file($dir . '/convert'))) {
System:
System Windows NT SHREK 5.1 build 2600
Server API Apache 2.0 Handler
PHP Version 4.3.11

Best regards,
Andrija

Re: Bug inside serendipity_query_default function.

Posted: Sat Apr 23, 2005 11:51 am
by garvinhicking
Hi!

Thanks a lot for the path. I have committed a patch that uses PATH_SEPARATOR now instead and checks for the empty dir.

However I don't know how your $dir part could be empty, since $_SERVER['PATH'] should never be empty and thus couldn't contain an empty array value?

Regards,
Garvin

Posted: Sun Apr 24, 2005 1:56 am
by BobRock
I have no idea also, but with a invalid separator a found $dir was empty on my system for a first iteration.
I could dump my PATH if you are interested.

I also experimenting with a IIS installation, ad if i found any problem/fix i will report it here.

Best Regards