mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix #1430 path conversion error in Windows
This commit is contained in:
parent
4bab8c4961
commit
438386f3dc
1 changed files with 2 additions and 5 deletions
|
|
@ -493,12 +493,10 @@ class ModuleObject extends BaseObject
|
|||
public function setTemplatePath($path)
|
||||
{
|
||||
if(!$path) return $this;
|
||||
|
||||
if((strlen($path) >= 1 && substr_compare($path, '/', 0, 1) !== 0) && (strlen($path) >= 2 && substr_compare($path, './', 0, 2) !== 0))
|
||||
if (!preg_match('!^(?:\\.?/|[A-Z]:[\\\\/]|\\\\\\\\)!i', $path))
|
||||
{
|
||||
$path = './' . $path;
|
||||
}
|
||||
|
||||
if(substr_compare($path, '/', -1) !== 0)
|
||||
{
|
||||
$path .= '/';
|
||||
|
|
@ -580,8 +578,7 @@ class ModuleObject extends BaseObject
|
|||
public function setLayoutPath($path)
|
||||
{
|
||||
if(!$path) return;
|
||||
|
||||
if((strlen($path) >= 1 && substr_compare($path, '/', 0, 1) !== 0) && (strlen($path) >= 2 && substr_compare($path, './', 0, 2) !== 0))
|
||||
if (!preg_match('!^(?:\\.?/|[A-Z]:[\\\\/]|\\\\\\\\)!i', $path))
|
||||
{
|
||||
$path = './' . $path;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue