phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] ged/inc class.ged_dm.inc.php


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] ged/inc class.ged_dm.inc.php
Date: Fri, 19 Oct 2007 12:37:16 +0000

CVSROOT:        /sources/phpgroupware
Module name:    ged
Changes by:     Pascal Vilarem <maat>   07/10/19 12:37:16

Modified files:
        inc            : class.ged_dm.inc.php 

Log message:
        fix : no more ugly crash when there are quotes in file names

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.48&r2=1.49

Patches:
Index: class.ged_dm.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- class.ged_dm.inc.php        28 Sep 2007 17:00:06 -0000      1.48
+++ class.ged_dm.inc.php        19 Oct 2007 12:37:16 -0000      1.49
@@ -184,7 +184,7 @@
                        $major=(int)$new_file['major'];
                        $minor=(int)$new_file['minor'];
 
-                       $sql1=sprintf($sql_model1, $this->tables['versions'], 
$new_file['file_size'], $new_file['file_name'], $candidate_name, $extension, 
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'working', 
$new_element_id, lang("First version"), $major, $minor);
+                       $sql1=sprintf($sql_model1, $this->tables['versions'], 
$new_file['file_size'], addslashes($new_file['file_name']), 
addslashes($candidate_name), $extension, 
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'working', 
$new_element_id, lang("First version"), $major, $minor);
 
                        //print ("<br/>".$sql1);
 
@@ -475,7 +475,7 @@
                                $sql_model1="INSERT INTO %s ( size, file_name, 
stored_name, file_extension, creator_id, creation_date, status, element_id, 
description, major, minor ) VALUES ";
                                $sql_model1.=" (  %d, '%s', '%s', '%s', %d, %d, 
'%s', %d, '%s', %d, %d ) ";
        
-                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], $new_version['file_size'], 
$new_version['file_name'], $candidate_name, $extension, 
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'working', 
$new_version['element_id'], $this->cleanstr($new_version['description']), 
$major, $minor);
+                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], $new_version['file_size'], 
addslashes($new_version['file_name']), addslashes($candidate_name), $extension, 
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'working', 
$new_version['element_id'], $this->cleanstr($new_version['description']), 
$major, $minor);
        
                                //print ("<br/>".$sql1);
        
@@ -2392,6 +2392,13 @@
                return ( $result );
        }
 
+       function set_version_status($version_id, $next_status)
+       {
+               $sql="UPDATE ged_versions set status='".$next_status."' WHERE 
version_id=".$version_id;                 
+               $this->db->query($sql, __LINE__, __FILE__);
+               $this->db->unlock();            
+       }
+       
        // relations management
        
        function list_version_relations_out ( $version_id )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]