Bug #21507 Bug Fixed

Creating template group results in errors . 3.1

Version: 3.1.0 Reporter: SChristy

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

This is for a clean install of EE 3.1 (sorry, 3.1 wasn’t an option in software version affected).

In “Template Settings”, choose “Save templates as files”. In “Template Manger”, create a new template group. You will get a bunch of warnings:

mkdir(): Invalid path

ee/EllisLab/ExpressionEngine/Library/Fil
esystem/Filesystem.php, line 87

and no files will be saved (including the default directory where the template groups should exist).

 

  • This is a minor patch, but it has a number of spots to make tiny changes to, in two files. Line numbers will match up only if you include our whitespace styles, but original code is supplied so you can find the right bits. First in system/ee/EllisLab/ExpressionEngine/Library/Filesystem/Filesystem.php line 65 add:

    $path = $this->normalize($path);

    Then around line 76 change:

    file_put_contents($this->normalize($path), $data);

    to

    file_put_contents($path, $data);

    Then around line 89 change:

    mkdir($this->normalize($path), DIR_WRITE_MODE, TRUE);

    to:

    $path = $this->normalize($path);
    mkdir($path, DIR_WRITE_MODE, TRUE);

    Then line 484 change:

    return realpath($path);

    to:

    return $path;

    Next up, in the file system/ee/EllisLab/ExpressionEngine/Service/File/Directory.php change line 24 from:

    $path = realpath($this->root.'/'.$path);

    to:

    $path = $this->root.'/'.$path;

    And replace this block starting on line 26:

    if ($path === FALSE)
    {
        return NULL;
    }
    
    if (strpos($path, $this->root) !== 0)

    With:

    if (strpos($path, '..') !== 0)
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases