phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] calendar/inc/class.boicalendar.inc.php, 1.16.2.4.2.4


From: nomail
Subject: [Phpgroupware-cvs] calendar/inc/class.boicalendar.inc.php, 1.16.2.4.2.4
Date: Sun, 23 May 2004 06:01:50 -0000

Update of /calendar/inc
Modified Files:
        Branch: Version-0_9_16-branch
          class.boicalendar.inc.php

date: 2004/05/01 09:58:22;  author: skwashd;  state: Exp;  lines: +18 -9

Log Message:
patch #2927 fixes bug #5848
=====================================================================
Index: calendar/inc/class.boicalendar.inc.php
diff -u calendar/inc/class.boicalendar.inc.php:1.16.2.4.2.3 
calendar/inc/class.boicalendar.inc.php:1.16.2.4.2.4
--- calendar/inc/class.boicalendar.inc.php:1.16.2.4.2.3 Mon Sep 29 10:18:18 2003
+++ calendar/inc/class.boicalendar.inc.php      Sat May  1 09:58:22 2004
@@ -967,7 +967,7 @@
                                        'dtstart'               => True
                                )
                        ),
-                       'enocding'      => Array(
+                       'encoding'      => Array( // "future bug" fix
                                'type'          => 'function',
                                'function'      => 'switch_encoding',
                                'quoted'                => False,
@@ -2895,7 +2895,7 @@
 
                function import_file()
                {
-                       if($GLOBALS['uploadedfile'] == 'none' || 
$GLOBALS['uploadedfile'] == '')
+                       if( ! is_array($_FILES['uploadedfile']) || 
$_FILES['uploadedfile']['tmp_name'] == '' /*|| 
$_FILES['uploadedfile']['tmp_name'] = 'none'*/)
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',
                                                Array(
@@ -2904,18 +2904,27 @@
                                                )
                                        )
                                );
-                               $GLOBALS['phpwg']->common->phpgw_exit();
+                               $GLOBALS['phpgw']->common->phpgw_exit();
                        }
                        $uploaddir = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . SEP;
 
                        srand((double)microtime()*1000000);
                        $random_number = rand(100000000,999999999);
-                       $newfilename = md5($GLOBALS['uploadedfile'].", 
".$uploadedfile_name.", "
+                       $newfilename = md5($_FILES['uploadedfile']['name'].", 
".$uploadedfile_name.", "
                                . time() . getenv("REMOTE_ADDR") . 
$random_number );
 
                        $filename = $uploaddir . $newfilename;
-
-                       move_uploaded_file($GLOBALS['uploadedfile'], $filename);
+                       if ( 
!move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $filename) )
+                       {
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',
+                                               Array(
+                                                       'menuaction'    => 
'calendar.uiicalendar.import',
+                                                       'action'    => 'GetFile'
+                                               )
+                                       )
+                               );
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
 //                     $ftp = fopen($uploaddir . $newfilename . '.info','wb');
 //                     
fputs($ftp,$uploadedfile_type."\n".$uploadedfile_name."\n");
 //                     fclose($ftp);
@@ -2924,7 +2933,7 @@
 
                function import($mime_msg='')
                {
-                       if($GLOBALS['uploadedfile'] != 'none' && 
$GLOBALS['uploadedfile'] != '')
+                       if( is_array($_FILES['uploadedfile']) && 
$_FILES['uploadedfile']['name'] != '')
                        {
                                $filename = $this->import_file();
                                $fp=fopen($filename,'rt');
@@ -2941,7 +2950,7 @@
                                                )
                                        )
                                );
-                               $GLOBALS['phpwg']->common->phpgw_exit();        
                        
+                               $GLOBALS['phpgw']->common->phpgw_exit();        
                        
                        }
 
                        if(!is_object($GLOBALS['uicalendar']))




reply via email to

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