Index: branches/5.2.x/core/kernel/utility/http_query.php =================================================================== diff -u -N -r14585 -r14628 --- branches/5.2.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 14585) +++ branches/5.2.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 14628) @@ -1,6 +1,6 @@ $file_info) - { - if( is_array($file_info['error']) ) - { - $tmp[$file_name] = $this->getArrayLevel( $file_info['error'], $file_name ); + foreach ($_FILES as $file_name => $file_info) { + if ( is_array($file_info['error']) ) { + $tmp[$file_name] = $this->getArrayLevel($file_info['error'], $file_name); } - else - { + else { $normal_files[$file_name] = $file_info; } } - if(!$tmp) return false; + if ( !$tmp ) { + return ; + } $files = $_FILES; - $_FILES = Array(); + $_FILES = Array (); - foreach($tmp as $prefix => $prefix_files) - { + foreach ($tmp as $prefix => $prefix_files) { $anchor =& $_FILES; - foreach($prefix_files['keys'] as $key) - { + foreach ($prefix_files['keys'] as $key) { $anchor =& $anchor[$key]; } - foreach($prefix_files['value'] as $field_name) - { - unset($inner_anchor); - unset($copy); + + foreach ($prefix_files['value'] as $field_name) { + unset($inner_anchor, $copy); $work_copy = $prefix_files['keys']; - foreach($file_keys as $file_key) - { + + foreach ($file_keys as $file_key) { $inner_anchor =& $files[$prefix][$file_key]; - if (isset($copy)) - { + + if ( isset($copy) ) { $work_copy = $copy; } - else - { + else { $copy = $work_copy; } + array_shift($work_copy); - foreach($work_copy as $prefix_file_key) - { + foreach ($work_copy as $prefix_file_key) { $inner_anchor =& $inner_anchor[$prefix_file_key]; } + $anchor[$field_name][$file_key] = $inner_anchor[$field_name]; } } } - // keys: img_temp, 0, values: LocalPath, ThumbPath } @@ -493,17 +487,21 @@ } /** - * Owerwrites GET events with POST events in case if they are set and not empty + * Overwrites GET events with POST events in case if they are set and not empty * + * @return void + * @access protected */ - function convertPostEvents() + protected function convertPostEvents() { - $events = $this->Get('events'); - if (is_array($events)) { + $events = $this->Get('events', Array ()); + /* @var $events Array */ + + if ( is_array($events) ) { + $events = array_filter($events); + foreach ($events as $prefix_special => $event_name) { - if ($event_name) { - $this->Set($prefix_special.'_event', $event_name); - } + $this->Set($prefix_special . '_event', $event_name); } } } @@ -535,6 +533,8 @@ function processRewriteURL() { $mod_rw_helper =& $this->Application->recallObject('ModRewriteHelper'); + /* @var $mod_rw_helper kModRewriteHelper */ + $mod_rw_helper->processRewriteURL(); } @@ -807,37 +807,39 @@ { $log_file = (defined('RESTRICTED') ? RESTRICTED : FULL_PATH) . '/' . $filename; - if ( is_writable( dirname($log_file) ) ) { + if ( is_writable(dirname($log_file)) ) { $fp = fopen($log_file, 'a'); - if ($fp) { + if ( $fp ) { $session =& $this->Application->recallObject('Session'); + /* @var $session Session */ + $user_id = $session->GetField('PortalUserId'); $admin_mark = $this->Application->isAdmin ? 'ADMIN' : 'FRONT'; - $data = '['.date('D M d H:i:s Y').'] '.$admin_mark.'; ip: '.$_SERVER['REMOTE_ADDR'].'; user_id: '.$user_id.'; sid: '.$this->Application->GetSID().'; request: '."\n"; - if ($this->Get) { - $data .= "_GET:\n".print_r($this->Get, true); + $data = '[' . date('D M d H:i:s Y') . '] ' . $admin_mark . '; ip: ' . $_SERVER['REMOTE_ADDR'] . '; user_id: ' . $user_id . '; sid: ' . $this->Application->GetSID() . '; request: ' . "\n"; + if ( $this->Get ) { + $data .= "_GET:\n" . print_r($this->Get, true); } - if ($this->Post) { - $data .= "_POST:\n".print_r($this->Post, true); + if ( $this->Post ) { + $data .= "_POST:\n" . print_r($this->Post, true); } - if ($this->Cookie) { - $data .= "_COOKIE:\n".print_r($this->Cookie, true); + if ( $this->Cookie ) { + $data .= "_COOKIE:\n" . print_r($this->Cookie, true); } - $data .= str_repeat('=', 100)."\n"; + $data .= str_repeat('=', 100) . "\n"; fwrite($fp, $data); fclose($fp); } else { - trigger_error('Requrest Log directory not writable', E_USER_WARNING); + trigger_error('Request Log directory not writable', E_USER_WARNING); } } else { - trigger_error('Requrest Log directory not writable', E_USER_WARNING); + trigger_error('Request Log directory not writable', E_USER_WARNING); } }