Bug in "\libraries\joomla\filesystem\path.php"

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
maybeling
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Nov 03, 2015 10:06 pm

Bug in "\libraries\joomla\filesystem\path.php"

Post by maybeling » Tue Nov 03, 2015 10:12 pm

This is Joomla 3.4.5 hosted in IIS on a UNC path.

When submitting a new article if I choose the "Image" button I get an error unless I change the clean function in "\libraries\joomla\filesystem\path.php" as follows:

Code: Select all

public static function clean($path, $ds = DIRECTORY_SEPARATOR)
{
    if (!is_string($path) && !empty($path))
    {
        throw new UnexpectedValueException('JPath::clean: $path is not a string.');
    }
    $path = trim($path);
    if (empty($path))
    {
        $path = JPATH_ROOT;
    }
    // Remove double slashes and backslashes and convert all slashes and backslashes to DIRECTORY_SEPARATOR
    // If dealing with a UNC path don't forget to prepend the path with a backslash.
    // This causes errors, fixed below
    /*elseif (($ds == '\\') && ($path[0] == '\\' ) && ( $path[1] == '\\' ))
    {
        $path = "\\" . preg_replace('#[/\\\\]+#', $ds, $path);
    }*/
    else
    {
        $path = preg_replace('#[/\\\\]+#', $ds, $path);
        // Adding this to resolve issues with UNC paths
        if (($ds == '\\') && $path[0] == '\\')
        {
            $path = $ds . $path;
        }
    }
    return $path;
}
Last edited by imanickam on Wed Nov 04, 2015 3:02 am, edited 1 time in total.
Reason: Moved topic » from Joomla! 3.x on IIS webserver to Joomla! 3.x Bug Reporting

Locked

Return to “Joomla! 3.x Bug Reporting”