[PATCH] Use PMF_String_Basic::strlen instead of PMF_String::

Please report bugs here!

Moderator: Thorsten

Post Reply
bram
Posts: 19
Joined: Mon Aug 16, 2010 12:54 pm

[PATCH] Use PMF_String_Basic::strlen instead of PMF_String::

Post by bram »

When an attachment is uploaded and the filename does not contain an extension then the upload fails with the error:
PHP Fatal error: Call to a member function strlen() on a non-object in /opt/supfaq/inc/String.php on line 103

The reason that this does not work is because inc/Init.php contains:

Code: Select all

        if (!isset($path_parts['extension']) && (PMF_String::strlen($path_parts['basename']) == 0)) {
            return '';
        }
=> extension is empty
=> basename is not empty
=> PMF_String is not initialized
=> error


Attached is a patch for this (0001-Use-PMF_String_Basic-strlen-instead-of-PMF_String.patch).
NOTE: this patch was originally written on 2.6.7. It is untested on the git HEAD.
You do not have the required permissions to view the files attached to this post.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: [PATCH] Use PMF_String_Basic::strlen instead of PMF_String::

Post by Thorsten »

Hi,

thanks for the fix, I added it for 2.6.8.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply