Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29958
Modified Files:
serendipity_admin_images.inc.php
Log Message:
After discussion and debugging session with Garvin I have reverted this
patch.
Index: serendipity_admin_images.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_images.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- serendipity_admin_images.inc.php 22 Mar 2004 12:13:07 -0000 1.17
+++ serendipity_admin_images.inc.php 22 Mar 2004 14:26:02 -0000 1.18
@@ -59,13 +59,13 @@
$file = serendipity_fetchImageFromDatabase($serendipity['GET']['fid']);
$newfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['GET']['newname'] . '.' . $file['extension'];
$oldfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['name'] . '.'. $file['extension'];
- if ( $serendipity['GET']['newname']!= '' && file_exists($oldfile) && !file_exists($newfile) ) {
+ if ($serendipity['GET']['newname'] != '' && file_exists($oldfile) && !file_exists($newfile)) {
// Rename file
rename($oldfile, $newfile);
// Rename thumbnail
- rename( $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['name'] . '.' . $file['thumbnail_name'] . '.' . $file['extension'],
- $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['GET']['newname'] . '.' . $serendipity['thumbSuffix'] . '.' . $file['extension']);
+ rename($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['name'] . '.' . $file['thumbnail_name'] . '.' . $file['extension'],
+ $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['GET']['newname'] . '.' . $serendipity['thumbSuffix'] . '.' . $file['extension']);
serendipity_updateImageInDatabase(array('thumbnail_name' => $serendipity['thumbSuffix'], 'name' => $serendipity['GET']['newname']), $serendipity['GET']['fid']);
// Forward user to overview (we don't want the user's back button to rename things again)
@@ -96,24 +96,23 @@
<?php
// First find out whether to fetch a file or accept an upload
- $checkfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . basename($serendipity['POST']['myurl']);
- if ($serendipity['POST']['myurl'] != '' && $serendipity['POST']['myurl'] != 'http://') {
+ $checkfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . basename($serendipity['POST']['url']);
+ if ($serendipity['POST']['url'] != '' && $serendipity['POST']['url'] != 'http://') {
if (file_exists($checkfile)) {
- print "|$checkfile|".$serendipity['POST']['myurl']."|<br />\n";
echo ERROR_FILE_EXISTS_ALREADY;
} else {
// Fetch file
- if (!$fContent = @file_get_contents($serendipity['POST']['myurl']) ) {
- printf(REMOTE_FILE_NOT_FOUND, $serendipity['POST']['myurl']);
+ if (!$fContent = @file_get_contents($serendipity['POST']['url']) ) {
+ printf(REMOTE_FILE_NOT_FOUND, $serendipity['POST']['url']);
} else {
$fp = fopen($checkfile, 'w');
fwrite($fp, $fContent);
fclose($fp);
- printf(FILE_FETCHED . '<br />', $serendipity['POST']['myurl']);
+ printf(FILE_FETCHED . '<br />', $serendipity['POST']['url']);
// Create thumbnail
- serendipity_makeThumbnail(basename($serendipity['POST']['myurl']));
+ serendipity_makeThumbnail(basename($serendipity['POST']['url']));
echo THUMB_CREATED_DONE . '<br />';
}
}
@@ -124,6 +123,8 @@
// Accept file
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $_FILES['userfile']['name'])) {
printf(FILE_UPLOADED . '<br />', $_FILES['userfile']['name']);
+ @umask(0000);
+ @chmod($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $_FILES['userfile']['name'], 0664);
// Create thumbnail
serendipity_makeThumbnail($_FILES['userfile']['name']);
|