Index: branches/5.3.x/core/kernel/db/db_connection.php =================================================================== diff -u -N -r15956 -r16226 --- branches/5.3.x/core/kernel/db/db_connection.php (.../db_connection.php) (revision 15956) +++ branches/5.3.x/core/kernel/db/db_connection.php (.../db_connection.php) (revision 16226) @@ -1,6 +1,6 @@ errorHandler)) { - $func = $this->errorHandler[1]; - $ret = $this->errorHandler[0]->$func($this->errorCode, $this->errorMessage, $sql); - } - else { - $func = $this->errorHandler; - $ret = $func($this->errorCode, $this->errorMessage, $sql); - } - - return $ret; + return call_user_func($this->errorHandler, $this->errorCode, $this->errorMessage, $sql); } /** Index: branches/5.3.x/core/kernel/db/dblist.php =================================================================== diff -u -N -r16124 -r16226 --- branches/5.3.x/core/kernel/db/dblist.php (.../dblist.php) (revision 16124) +++ branches/5.3.x/core/kernel/db/dblist.php (.../dblist.php) (revision 16226) @@ -1,6 +1,6 @@ OrderFields = Array(); + foreach ( $this->getFilterStructure() as $filter_params ) { + $property_name = $filter_params['type']; + $filter_group =& $this->$property_name; - $filters = $this->getFilterStructure(); - - foreach ($filters as $filter_params) { - $filter =& $this->$filter_params['type']; - $filter[ $filter_params['class'] ] = $this->Application->makeClass('kMultipleFilter', Array ($filter_params['join_using'])); + $filter_group[$filter_params['class']] = $this->Application->makeClass( + 'kMultipleFilter', + array($filter_params['join_using']) + ); } $this->PerPage = -1; @@ -317,19 +319,7 @@ */ public function addFilter($name, $clause, $filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM) { - $filter_source = Array ( - self::WHERE_FILTER => 'WhereFilter', - self::HAVING_FILTER => 'HavingFilter', - self::AGGREGATE_FILTER => 'AggregateFilter' - ); - - $filter_name = $filter_source[$filter_type]; - - $filter =& $this->$filter_name; - $filter =& $filter[$filter_scope]; - /* @var $filter kMultipleFilter */ - - $filter->addFilter($name, $clause); + $this->getFilterCollection($filter_type, $filter_scope)->addFilter($name, $clause); } /** @@ -343,19 +333,7 @@ */ public function getFilter($name, $filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM) { - $filter_source = Array ( - self::WHERE_FILTER => 'WhereFilter', - self::HAVING_FILTER => 'HavingFilter', - self::AGGREGATE_FILTER => 'AggregateFilter' - ); - - $filter_name = $filter_source[$filter_type]; - - $filter =& $this->$filter_name; - $filter =& $filter[$filter_scope]; - /* @var $filter kMultipleFilter */ - - return $filter->getFilter($name); + return $this->getFilterCollection($filter_type, $filter_scope)->getFilter($name); } /** @@ -368,19 +346,30 @@ */ public function removeFilter($name, $filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM) { - $filter_source = Array ( + $this->getFilterCollection($filter_type, $filter_scope)->removeFilter($name); + } + + /** + * Returns filter collection. + * + * @param integer $filter_type Is filter having filter or where filter. + * @param integer $filter_scope Filter subtype: FLT_NORMAL,FLT_SYSTEM,FLT_SEARCH,FLT_VIEW,FLT_CUSTOM. + * + * @return kMultipleFilter + */ + protected function getFilterCollection($filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM) + { + $filter_source = array( self::WHERE_FILTER => 'WhereFilter', self::HAVING_FILTER => 'HavingFilter', self::AGGREGATE_FILTER => 'AggregateFilter' ); - $filter_name = $filter_source[$filter_type]; + /** @var kMultipleFilter[] $filters */ + $property_name = $filter_source[$filter_type]; + $filters =& $this->$property_name; - $filter =& $this->$filter_name; - $filter =& $filter[$filter_scope]; - /* @var $filter kMultipleFilter */ - - $filter->removeFilter($name); + return $filters[$filter_scope]; } /** @@ -390,11 +379,11 @@ */ public function clearFilters() { - $filters = $this->getFilterStructure(); + foreach ( $this->getFilterStructure() as $filter_params ) { + $property_name = $filter_params['type']; + $filter_group =& $this->$property_name; - foreach ($filters as $filter_params) { - $filter =& $this->$filter_params['type']; - $filter[ $filter_params['class'] ]->clearFilters(); + $filter_group[$filter_params['class']]->clearFilters(); } } Index: branches/5.3.x/core/units/helpers/json_helper.php =================================================================== diff -u -N -r15483 -r16226 --- branches/5.3.x/core/units/helpers/json_helper.php (.../json_helper.php) (revision 15483) +++ branches/5.3.x/core/units/helpers/json_helper.php (.../json_helper.php) (revision 16226) @@ -1,6 +1,6 @@ \f // return str_replace(array(chr(0x08), chr(0x0C)), array('\b', '\f'), $string); } - } \ No newline at end of file + } Index: branches/5.3.x/core/units/images/image_tag_processor.php =================================================================== diff -u -N -r16111 -r16226 --- branches/5.3.x/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 16111) +++ branches/5.3.x/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 16226) @@ -1,6 +1,6 @@ LoadItemImage($params); - return $this->$params['original_tag']($params); + $tag_name = $params['original_tag']; + + return $this->$tag_name($params); } function LargeImageExists($params) Index: branches/5.3.x/core/units/categories/cache_updater.php =================================================================== diff -u -N -r15483 -r16226 --- branches/5.3.x/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 15483) +++ branches/5.3.x/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 16226) @@ -1,6 +1,6 @@ Stack = Array(); } @@ -73,9 +76,15 @@ */ var $table = ''; - function clsCachedPermissions($CatId, $table_name) + /** + * Creates class instance. + * + * @param integer $cat_id Category ID. + * @param string $table_name Table name. + */ + public function __construct($cat_id, $table_name) { - $this->CatId = $CatId; + $this->CatId = $cat_id; $this->table = $table_name; } @@ -541,4 +550,4 @@ $this->SaveData(); } - } \ No newline at end of file + } Index: branches/5.3.x/core/units/helpers/mailbox_helper.php =================================================================== diff -u -N -r15483 -r16226 --- branches/5.3.x/core/units/helpers/mailbox_helper.php (.../mailbox_helper.php) (revision 15483) +++ branches/5.3.x/core/units/helpers/mailbox_helper.php (.../mailbox_helper.php) (revision 16226) @@ -1,6 +1,6 @@ ExtractRecipientEmail($this->headers['from']); $good['fromname'] = $esender->ExtractRecipientName($this->headers['from'], $good['fromemail']); - // Get the list of recipients - if (!$verify_callback[0]->$verify_callback[1]($callback_params)) { - // error: mail is propably spam + // Get the list of recipients. + if ( !call_user_func($verify_callback, $callback_params) ) { + // Error: mail is probably spam. return false; } @@ -356,7 +356,7 @@ 'Size' => strlen($message), ); - return $process_callback[0]->$process_callback[1]($callback_params, $fields_hash); + return call_user_func($process_callback, $callback_params, $fields_hash); } /** @@ -492,4 +492,4 @@ $parts['headers'] = $decoded->headers; // headers of next parts overwrite previous part headers } - } \ No newline at end of file + } Index: branches/5.3.x/core/install/install_toolkit.php =================================================================== diff -u -N -r16180 -r16226 --- branches/5.3.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 16180) +++ branches/5.3.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 16226) @@ -1,6 +1,6 @@ systemConfig = new kSystemConfig(true, false);