Bug inside serendipity_query_default function.

Found a bug? Tell us!!
Post Reply
BobRock
Posts: 2
Joined: Fri Apr 22, 2005 2:12 pm
Location: Zagreb - Croatia

Bug inside serendipity_query_default function.

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Bug inside serendipity_query_default function.

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
BobRock
Posts: 2
Joined: Fri Apr 22, 2005 2:12 pm
Location: Zagreb - Croatia

Post 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
CU, BobRock
Post Reply