Fatal error: Cannot re-assign $this in D:\Serwer\WebServ\httpd\commerce\sklep\admin\includes\classes\upload.php on line 31
a oto plik: (tresc edytowana w notatniku)
<?php /* $Id: upload.php,v 1.2 2003/06/20 00:18:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions Copyright Š 2003 osCommerce Released under the GNU General Public License */ class upload { var $file, $filename, $destination, $permissions, $extensions, $tmp_filename, $message_location; function upload($file = '', $destination = '', $permissions = '777', $extensions = '') { $this->set_file($file); $this->set_destination($destination); $this->set_permissions($permissions); $this->set_extensions($extensions); $this->set_output_messages('direct'); if (tep_not_null($this->file) && tep_not_null($this->destination)) { $this->set_output_messages('session'); if ( ($this->parse() == true) && ($this->save() == true) ) { return true; } else { // self destruct $this = null; return false; } } } function parse() { 'type' => $_FILES[$this->file]['type'], 'size' => $_FILES[$this->file]['size'], 'tmp_name' => $_FILES[$this->file]['tmp_name']); 'type' => $HTTP_POST_FILES[$this->file]['type'], 'size' => $HTTP_POST_FILES[$this->file]['size'], 'tmp_name' => $HTTP_POST_FILES[$this->file]['tmp_name']); } else { } if ( tep_not_null($file['tmp_name']) && ($file['tmp_name'] != 'none') && is_uploaded_file($file['tmp_name']) ) { if (!in_array(strtolower(substr($file['name'], strrpos($file['name'], '.')+1)), $this->extensions)) { if ($this->message_location == 'direct') { $messageStack->add(ERROR_FILETYPE_NOT_ALLOWED, 'error'); } else { $messageStack->add_session(ERROR_FILETYPE_NOT_ALLOWED, 'error'); } return false; } } $this->set_file($file); $this->set_filename($file['name']); $this->set_tmp_filename($file['tmp_name']); return $this->check_destination(); } else { if ($this->message_location == 'direct') { $messageStack->add(WARNING_NO_FILE_UPLOADED, 'warning'); } else { $messageStack->add_session(WARNING_NO_FILE_UPLOADED, 'warning'); } return false; } } function save() { chmod($this->destination . $this->filename, $this->permissions); if ($this->message_location == 'direct') { $messageStack->add(SUCCESS_FILE_SAVED_SUCCESSFULLY, 'success'); } else { $messageStack->add_session(SUCCESS_FILE_SAVED_SUCCESSFULLY, 'success'); } return true; } else { if ($this->message_location == 'direct') { $messageStack->add(ERROR_FILE_NOT_SAVED, 'error'); } else { $messageStack->add_session(ERROR_FILE_NOT_SAVED, 'error'); } return false; } } function set_file($file) { $this->file = $file; } function set_destination($destination) { $this->destination = $destination; } function set_permissions($permissions) { } function set_filename($filename) { $this->filename = $filename; } function set_tmp_filename($filename) { $this->tmp_filename = $filename; } function set_extensions($extensions) { if (tep_not_null($extensions)) { $this->extensions = $extensions; } else { } } else { } } function check_destination() { if ($this->message_location == 'direct') { } else { } } else { if ($this->message_location == 'direct') { } else { } } return false; } else { return true; } } function set_output_messages($location) { switch ($location) { case 'session': $this->message_location = 'session'; break; case 'direct': default: $this->message_location = 'direct'; break; } } } ?>