Index: branches/RC/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r11279 -r11281 --- branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 11279) +++ branches/RC/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 11281) @@ -791,13 +791,12 @@ $tag_sort_by = $event->getEventParam('sort_by'); if ($tag_sort_by) { if ($tag_sort_by == 'random') { - $by = 'RAND()'; - $dir = ''; - $object->AddOrderField($by, $dir); + $object->AddOrderField('RAND()', ''); } else { - foreach (explode('|', $tag_sort_by) as $sorting_element) { - list($by, $dir) = explode(',', $sorting_element); + $tag_sort_by = explode('|', $tag_sort_by); + foreach ($tag_sort_by as $sorting_element) { + list ($by, $dir) = explode(',', $sorting_element); $object->AddOrderField($by, $dir); } } @@ -2246,8 +2245,17 @@ function OnUploadFile(&$event) { $event->status = erSTOP; + define('DBG_SKIP_REPORTING', 1); echo "Flash requires that we output something or it won't fire the uploadSuccess event"; + if (!$this->Application->HttpQuery->Post) { + // Variables {field, id, flashsid} are always submitted through POST! + // When file size is larger, then "upload_max_filesize" (in php.ini), + // then theese variables also are not submitted -> handle such case. + header('HTTP/1.0 413 File size exceeds allowed limit'); + return ; + } + // Flash uploader does NOT send correct cookies, so we need to make our own check $cookie_name = 'adm_'.$this->Application->ConfigValue('SessionCookieName'); $this->Application->HttpQuery->Cookie['cookies_on'] = 1;