Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
848c8a4
)
fine tweaks to upload.php
author
Jason Woofenden
<jason183@herkamire.com>
Tue, 17 Apr 2007 17:48:15 +0000
(13:48 -0400)
committer
Jason Woofenden
<jason183@herkamire.com>
Tue, 17 Apr 2007 17:48:15 +0000
(13:48 -0400)
upload.php
patch
|
blob
|
history
diff --git
a/upload.php
b/upload.php
index
0f2a237
..
143482c
100644
(file)
--- a/
upload.php
+++ b/
upload.php
@@
-65,6
+65,7
@@
$GLOBALS['mime_to_ext'] = array(
'text/plain' => 'txt',
'text/html' => 'html',
'image/jpeg' => 'jpg',
'text/plain' => 'txt',
'text/html' => 'html',
'image/jpeg' => 'jpg',
+ 'image/jpe' => 'jpg',
'image/jpg' => 'jpg',
'image/gif' => 'gif',
'image/png' => 'png',
'image/jpg' => 'jpg',
'image/gif' => 'gif',
'image/png' => 'png',
@@
-116,7
+117,7
@@
function generate_filename($path, $mime = 'text/plain') {
# replace symbols with underscores
$filename = ereg_replace('[^a-z0-9_.]', '_', $filename);
# replace symbols with underscores
$filename = ereg_replace('[^a-z0-9_.]', '_', $filename);
- # remove dots from the begning (no invisible files)
+ # remove dots from the beginning (no invisible files)
$filename = ereg_replace('^\.*', '', $filename);
# fix extension
$filename = ereg_replace('^\.*', '', $filename);
# fix extension
@@
-181,7
+182,7
@@
function gif_to_png($filename, $new_filename = 'just change extension') {
if(!file_exists($convert)) {
$convert = `which convert`;
}
if(!file_exists($convert)) {
$convert = `which convert`;
}
- if(!file_exists($convert)) {
+ if($convert == '' || !file_exists($convert)) {
die("can't find imagemagick's 'convert' program");
}
die("can't find imagemagick's 'convert' program");
}