diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 74cb8e269..77237ed13 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -1030,15 +1030,6 @@ class Controller return false; } - /* - * Security check - */ - if (!\Cms\Helpers\File::validateIsLocalFile($partial->getFilePath())) { - throw new CmsException(Lang::get('cms::lang.cms_object.invalid_file', [ - 'name' => $partial->getFileName() - ])); - } - /* * Run functions for CMS partials only (Cms\Classes\Partial) */ diff --git a/modules/cms/helpers/File.php b/modules/cms/helpers/File.php index 83c39a85f..8849927e1 100644 --- a/modules/cms/helpers/File.php +++ b/modules/cms/helpers/File.php @@ -71,24 +71,4 @@ class File return true; } - - /** - * Validates a CMS object path is inside the application's base directory. - * @param string $filePath Specifies a path to validate - * @return boolean Returns true if the file path is local. Otherwise returns false. - */ - public static function validateIsLocalFile($filePath) - { - $restrictBaseDir = Config::get('cms.restrictBaseDir', true); - - if ($restrictBaseDir && !Filesystem::isLocalPath($filePath)) { - return false; - } - - if (!$restrictBaseDir && realpath($filePath) === false) { - return false; - } - - return true; - } }