Browse Source

Adding condition if file_exists to avoid warning messages

Julio Montoya 14 years ago
parent
commit
d06aca86e0
1 changed files with 4 additions and 2 deletions
  1. 4 2
      main/work/work.php

+ 4 - 2
main/work/work.php

@@ -787,8 +787,10 @@ else {
                         $new_file = $path.'work/DELETED_'.basename($url);    
                     } else {
                         $new_file = $path.dirname($url).'/DELETED_'.basename($url);
-                    }                    
-                    rename($path.$url, $new_file);
+                    }              
+                    if (file_exists($path.$url)) {      
+                        rename($path.$url, $new_file);
+                    }
                 }                             
 		    }			
 /*