mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 00:41:52 +00:00
[2.1.0] Fix bug in mkdir_deep that would prevent absolute paths in Unix systems from being created properly
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1321 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
f80de908bd
commit
a12ea4bb3b
@ -53,7 +53,13 @@ function mkdir_deep($folder) {
|
|||||||
$folders = preg_split("#[\\\\/]#", $folder);
|
$folders = preg_split("#[\\\\/]#", $folder);
|
||||||
$base = '';
|
$base = '';
|
||||||
for($i = 0, $c = count($folders); $i < $c; $i++) {
|
for($i = 0, $c = count($folders); $i < $c; $i++) {
|
||||||
if(empty($folders[$i])) continue;
|
if(empty($folders[$i])) {
|
||||||
|
if (!$i) {
|
||||||
|
// special case for root level
|
||||||
|
$base .= DIRECTORY_SEPARATOR;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$base .= $folders[$i];
|
$base .= $folders[$i];
|
||||||
if(!is_dir($base)){
|
if(!is_dir($base)){
|
||||||
mkdir($base);
|
mkdir($base);
|
||||||
|
Loading…
Reference in New Issue
Block a user