mirror of
git://develop.git.wordpress.org/
synced 2025-02-24 08:33:35 +01:00
CHMOD uploaded files to make sure they're writable.
git-svn-id: https://develop.svn.wordpress.org/trunk@1091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bc9a51116d
commit
cdeccb82f8
@ -128,8 +128,11 @@ case 'upload':
|
|||||||
if (!$moved) {
|
if (!$moved) {
|
||||||
die("Couldn't Upload Your File to $pathtofile2.");
|
die("Couldn't Upload Your File to $pathtofile2.");
|
||||||
} else {
|
} else {
|
||||||
|
chmod($pathtofile2, 0666);
|
||||||
@unlink($img1);
|
@unlink($img1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
// duplicate-renaming function contributed by Gary Lawrence Murphy
|
// duplicate-renaming function contributed by Gary Lawrence Murphy
|
||||||
?>
|
?>
|
||||||
@ -162,13 +165,14 @@ die();
|
|||||||
@$moved = move_uploaded_file($img1, $pathtofile); //Path to your images directory, chmod the dir to 777
|
@$moved = move_uploaded_file($img1, $pathtofile); //Path to your images directory, chmod the dir to 777
|
||||||
// move_uploaded_file() can fail if open_basedir in PHP.INI doesn't
|
// move_uploaded_file() can fail if open_basedir in PHP.INI doesn't
|
||||||
// include your tmp directory. Try copy instead?
|
// include your tmp directory. Try copy instead?
|
||||||
if(!moved) {
|
if(!$moved) {
|
||||||
$moved = copy($img1, $pathtofile);
|
$moved = copy($img1, $pathtofile);
|
||||||
}
|
}
|
||||||
// Still couldn't get it. Give up.
|
// Still couldn't get it. Give up.
|
||||||
if (!moved) {
|
if (!moved) {
|
||||||
die("Couldn't Upload Your File to $pathtofile.");
|
die("Couldn't Upload Your File to $pathtofile.");
|
||||||
} else {
|
} else {
|
||||||
|
chmod($pathtofile, 0666);
|
||||||
@unlink($img1);
|
@unlink($img1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +223,7 @@ Type:
|
|||||||
<?php echo $img1_type; ?>
|
<?php echo $img1_type; ?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p><a href="upload.php">Start over</a>.</p>
|
<p><a href="upload.php">Upload another</a>.</p>
|
||||||
<?php
|
<?php
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user