[dev] ansel image upload broken in HEAD

Tyler Colbert tyler-hordeml at colberts.us
Tue Sep 2 17:25:58 PDT 2003


Ansel from HEAD today doesn't deal with uploaded images right.

patch 1 -- Under PostgreSQL, 'default' needs to be typecast to a string before
being set into the category data.  (perhaps this should happen in the category
sql driver?)

patch 2 -- Gallery.php used to refer to uploaded image file name as ['tmp_name']
instead of ['file'].  I think this was a fairly recent name change in Form.php,
so I changed Gallery.php to match.

Please let me know if Im not submitting these right or something.  Im new to PHP
and Horde.

PS: Sorry bout the lack of a subject on the last post.
PPS: Chuck, your fix for Category/sql.php for Signup having a false from
Auth::getAuth() worked fine here.

--
Tyler Colbert
-------------- next part --------------
Index: image.php
===================================================================
RCS file: /repository/ansel/image.php,v
retrieving revision 1.28
diff -u -r1.28 image.php
--- image.php	31 Aug 2003 18:59:40 -0000	1.28
+++ image.php	3 Sep 2003 00:06:55 -0000
@@ -112,8 +112,8 @@
 
                     $form->getInfo($vars, $info);
 
-                    $fp = fopen($info['image_file']['tmp_name'], 'r');
-                    $image_data = fread($fp, filesize($info['image_file']['tmp_name']));
+                    $fp = fopen($info['image_file']['file'], 'r');
+                    $image_data = fread($fp, filesize($info['image_file']['file']));
                     fclose($fp);
 
                     $image = array('filename' => $info['image_file']['name'],
-------------- next part --------------
Index: Gallery.php
===================================================================
RCS file: /repository/ansel/lib/Gallery.php,v
retrieving revision 1.21
diff -u -r1.21 Gallery.php
--- Gallery.php	26 Aug 2003 22:16:39 -0000	1.21
+++ Gallery.php	3 Sep 2003 00:06:24 -0000
@@ -105,7 +105,7 @@
                                         'description' => $image['description'],
                                         'type' => $image['type'],
                                         'vfspath' => $vfspath,
-                                        'default' => $image['default']);
+                                        'default' => (string)$image['default']);
         $imageId = max(array_keys($this->data['images']));
         $this->data['images'][$imageId]['id'] = $imageId;
 


More information about the dev mailing list