Page MenuHomeIn-Portal Phabricator

D411.id1027.diff
No OneTemporary

File Metadata

Created
Wed, Feb 26, 8:59 AM

D411.id1027.diff

Index: core/ckeditor/ckfinder/core/connector/php/php5/Core/Config.php
===================================================================
--- core/ckeditor/ckfinder/core/connector/php/php5/Core/Config.php
+++ core/ckeditor/ckfinder/core/connector/php/php5/Core/Config.php
@@ -435,7 +435,7 @@
}
reset($GLOBALS['config']['ResourceType']);
- while (list($_key,$_resourceTypeNode) = each($GLOBALS['config']['ResourceType'])) {
+ foreach ($GLOBALS['config']['ResourceType'] as $_resourceTypeNode ) {
if ($_resourceTypeNode['name'] === $resourceTypeName) {
$this->_resourceTypeConfigCache[$resourceTypeName] = new CKFinder_Connector_Core_ResourceTypeConfig($_resourceTypeNode);
Index: core/ckeditor/ckfinder/core/connector/php/php5/Utils/Security.php
===================================================================
--- core/ckeditor/ckfinder/core/connector/php/php5/Utils/Security.php
+++ core/ckeditor/ckfinder/core/connector/php/php5/Utils/Security.php
@@ -43,7 +43,7 @@
$this->stripQuotes($_COOKIE);
}
if (!empty($_FILES)) {
- while (list($k,$v) = each($_FILES)) {
+ foreach ( array_keys($_FILES) as $k ) {
if (isset($_FILES[$k]['name'])) {
$this->stripQuotes($_FILES[$k]['name']);
}
@@ -64,7 +64,7 @@
{
if (is_array($var)) {
if ($depth++<$howDeep) {
- while (list($k,$v) = each($var)) {
+ foreach ( array_keys($var) as $k ) {
$this->stripQuotes($var[$k], $depth, $howDeep);
}
}
Index: core/install.php
===================================================================
--- core/install.php
+++ core/install.php
@@ -1085,7 +1085,8 @@
continue;
}
- list ($parent_name, $parent_version) = each($version_dependencies);
+ $parent_name = key($version_dependencies);
+ $parent_version = $version_dependencies[$parent_name];
if (!array_key_exists($parent_name, $dependencies)) {
// parent module
@@ -1182,7 +1183,8 @@
if (array_key_exists($module_name, $this->upgradeDepencies) && array_key_exists($version, $this->upgradeDepencies[$module_name])) {
foreach ($this->upgradeDepencies[$module_name][$version] as $dependency_info) {
- list ($dependent_module, $dependent_version) = each($dependency_info);
+ $dependent_module = key($dependency_info);
+ $dependent_version = $dependency_info[$dependent_module];
if (!$this->RunUpgrade($dependent_module, $dependent_version, $upgrade_data, $start_from_query)) {
return false;
Index: core/kernel/db/cat_event_handler.php
===================================================================
--- core/kernel/db/cat_event_handler.php
+++ core/kernel/db/cat_event_handler.php
@@ -202,7 +202,8 @@
if (!$items) {
// when item not present in temp table, then permission is not checked, because there are no data in db to check
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- list ($id, $fields_hash) = each($items_info);
+ $id = key($items_info);
+ $fields_hash = $items_info[$id];
if (array_key_exists('CategoryId', $fields_hash)) {
$item_category = $fields_hash['CategoryId'];
@@ -2179,7 +2180,8 @@
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ( $items_info ) {
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
/** @var kDBItem $object */
$object = $event->getObject(Array ('skip_autoload' => true));
Index: core/kernel/db/db_event_handler.php
===================================================================
--- core/kernel/db/db_event_handler.php
+++ core/kernel/db/db_event_handler.php
@@ -1235,7 +1235,7 @@
if ( isset($custom_filters[$grid_name]) ) {
foreach ($custom_filters[$grid_name] as $field_name => $field_options) {
- list ($filter_type, $field_options) = each($field_options);
+ $field_options = current($field_options);
if ( isset($field_options['value']) && $field_options['value'] ) {
$filter_type = ($field_options['sql_filter_type'] == 'having') ? kDBList::HAVING_FILTER : kDBList::WHERE_FILTER;
@@ -1569,7 +1569,8 @@
return;
}
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
$object->setID($id);
$object->SetFieldsFromHash($field_values);
$event->setEventParam('form_data', $field_values);
@@ -2940,7 +2941,7 @@
$items_info = $this->Application->GetVar('u');
if ( $items_info ) {
- list ($user_id, ) = each($items_info);
+ $user_id = key($items_info);
$this->RemoveRequiredFields($object);
$is_new = !$object->isLoaded();
@@ -3293,7 +3294,8 @@
return;
}
- list ($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$event->setEventParam('form_data', $field_values);
Index: core/units/categories/categories_event_handler.php
===================================================================
--- core/units/categories/categories_event_handler.php
+++ core/units/categories/categories_event_handler.php
@@ -202,7 +202,8 @@
if (!$items) {
// when creating new category, then no IDs are stored in session
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- list ($id, $fields_hash) = each($items_info);
+ $id = key($items_info);
+ $fields_hash = $items_info[$id];
if (array_key_exists('ParentId', $fields_hash)) {
$item_category = $fields_hash['ParentId'];
Index: core/units/content/content_eh.php
===================================================================
--- core/units/content/content_eh.php
+++ core/units/content/content_eh.php
@@ -150,7 +150,7 @@
/** @var kDBItem $revision */
/** @var kDBItem $object */
- list (, $field_values) = each($items_info);
+ $field_values = current($items_info);
$object->SetFieldsFromHash($field_values);
$event->setEventParam('form_data', $field_values);
$updated = $object->Update();
@@ -236,7 +236,7 @@
return array();
}
- list ($id,) = each($items_info);
+ $id = key($items_info);
$object->Load($id);
/** @var kDBItem $revision */
Index: core/units/email_templates/email_template_eh.php
===================================================================
--- core/units/email_templates/email_template_eh.php
+++ core/units/email_templates/email_template_eh.php
@@ -194,7 +194,7 @@
$items_info = $this->Application->GetVar('u');
if ( $items_info ) {
- list ($user_id, ) = each($items_info);
+ $user_id = key($items_info);
$ids = $this->Application->RecallVar($event->getPrefixSpecial() . '_selected_ids');
$id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
Index: core/units/helpers/brackets_helper.php
===================================================================
--- core/units/helpers/brackets_helper.php
+++ core/units/helpers/brackets_helper.php
@@ -359,8 +359,6 @@
// sort brackets by 2nd column (Max values)
uasort($temp, Array (&$this, 'compareBrackets'));
reset($temp);
- $first_item = each($temp);
- $first_item_key = $first_item['key'];
$linked_info = $object->getLinkedInfo();
$sql = 'SELECT %s FROM %s WHERE %s = %s';
Index: core/units/helpers/captcha_helper.php
===================================================================
--- core/units/helpers/captcha_helper.php
+++ core/units/helpers/captcha_helper.php
@@ -160,7 +160,7 @@
if ($check_request) {
// perform validation only when field is found on form
- list ($id, $field_values) = each($this->Application->GetVar($event->getPrefixSpecial()));
+ $field_values = current($this->Application->GetVar($event->getPrefixSpecial()));
if (!array_key_exists('Captcha', $field_values)) {
// when captcha code not submitted
return true;
@@ -182,4 +182,4 @@
return true;
}
-}
\ No newline at end of file
+}
Index: core/units/helpers/cat_dbitem_export_helper.php
===================================================================
--- core/units/helpers/cat_dbitem_export_helper.php
+++ core/units/helpers/cat_dbitem_export_helper.php
@@ -1310,7 +1310,7 @@
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info)
{
- list($item_id, $field_values) = each($items_info);
+ $field_values = current($items_info);
$export_keys = $field_values['ExportColumns'];
$export_keys = $export_keys ? explode('|', substr($export_keys, 1, -1) ) : Array();
}
@@ -1452,7 +1452,8 @@
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
}
- list($item_id, $field_values) = each($items_info);
+ $item_id = key($items_info);
+ $field_values = $items_info[$item_id];
/** @var kDBItem $object */
$object = $event->getObject(Array ('skip_autoload' => true));
Index: core/units/helpers/controls/minput_helper.php
===================================================================
--- core/units/helpers/controls/minput_helper.php
+++ core/units/helpers/controls/minput_helper.php
@@ -84,7 +84,7 @@
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($items_info) {
- list ($id, $field_values) = each($items_info);
+ $field_values = current($items_info);
foreach ($field_values as $field_name => $field_value) {
$object->SetField($field_name, $field_value);
@@ -215,4 +215,4 @@
}
}
}
- }
\ No newline at end of file
+ }
Index: core/units/helpers/file_helper.php
===================================================================
--- core/units/helpers/file_helper.php
+++ core/units/helpers/file_helper.php
@@ -140,7 +140,7 @@
{
$items_info = $this->Application->GetVar($prefix);
if ($items_info) {
- list (, $fields_values) = each($items_info);
+ $fields_values = current($items_info);
$this->createUploadFields($prefix, $fields_values, $is_image);
}
else {
Index: core/units/helpers/search_helper.php
===================================================================
--- core/units/helpers/search_helper.php
+++ core/units/helpers/search_helper.php
@@ -429,7 +429,8 @@
$submit_filters = getArrayValue($submit_filters, $event->getPrefixSpecial(), $grid_name);
if ($submit_filters) {
foreach ($submit_filters as $field_name => $field_options) {
- list ($filter_type, $field_value) = each($field_options);
+ $filter_type = key($field_options);
+ $field_value = $field_options[$filter_type];
$is_empty = strlen(is_array($field_value) ? implode('', $field_value) : $field_value) == 0;
if ($is_empty) {
if (isset($custom_filter[$field_name])) {
@@ -466,7 +467,8 @@
$object = $event->getObject(); // don't recall it each time in getCustomFilterSearchClause
$grid_info = $this->Application->getUnitOption($event->Prefix.'.'.$grid_name, 'Grids');
foreach ($custom_filter as $field_name => $field_options) {
- list ($filter_type, $field_options) = each($field_options);
+ $filter_type = key($field_options);
+ $field_options = $field_options[$filter_type];
$field_options['grid_options'] = $grid_info['Fields'][$field_name];
$field_options = $this->getCustomFilterSearchClause($object, $field_name, $filter_type, $field_options);
if ($field_options['value']) {
@@ -515,7 +517,8 @@
$custom_filter = $custom_filters[$grid_name];
foreach ($custom_filter as $field_name => $field_options) {
- list ($filter_type, $field_options) = each($field_options);
+ $filter_type = key($field_options);
+ $field_options = $field_options[$filter_type];
if (strpos($filter_type, 'range') === false) {
continue;
Index: core/units/languages/languages_event_handler.php
===================================================================
--- core/units/languages/languages_event_handler.php
+++ core/units/languages/languages_event_handler.php
@@ -565,7 +565,8 @@
$items_info = $this->Application->GetVar('phrases_import');
if ($items_info) {
- list ($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
/** @var kDBItem $object */
$object = $this->Application->recallObject('phrases.import', 'phrases', Array('skip_autoload' => true));
@@ -638,7 +639,8 @@
{
$items_info = $this->Application->GetVar('phrases_export');
if ( $items_info ) {
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
/** @var kDBItem $object */
$object = $this->Application->recallObject('phrases.export', null, Array ('skip_autoload' => true));
Index: core/units/reviews/reviews_event_handler.php
===================================================================
--- core/units/reviews/reviews_event_handler.php
+++ core/units/reviews/reviews_event_handler.php
@@ -121,7 +121,7 @@
if ($items_info) {
// rev:PresetFormFields is used to initialize new review creation
- list ($review_id, ) = each($items_info);
+ $review_id = key($items_info);
}
else {
// when adding new review in admin
@@ -633,4 +633,4 @@
$parent_prefix = $event->Application->getUnitOption($event->Prefix, 'ParentPrefix');
$event->SetRedirectParam('pass', 'm,' . $event->getPrefixSpecial() . ',' . $parent_prefix);
}
- }
\ No newline at end of file
+ }
Index: core/units/selectors/selectors_event_handler.php
===================================================================
--- core/units/selectors/selectors_event_handler.php
+++ core/units/selectors/selectors_event_handler.php
@@ -210,7 +210,8 @@
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ( $items_info ) {
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
if ( $id == 0 ) {
$parent_id = getArrayValue($field_values, 'ParentId');
Index: core/units/theme_files/theme_file_eh.php
===================================================================
--- core/units/theme_files/theme_file_eh.php
+++ core/units/theme_files/theme_file_eh.php
@@ -184,7 +184,8 @@
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if ($items_info) {
- list ($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
$object->setID($id);
$object->SetFieldsFromHash($field_values);
$event->setEventParam('form_data', $field_values);
Index: core/units/user_profile/user_profile_eh.php
===================================================================
--- core/units/user_profile/user_profile_eh.php
+++ core/units/user_profile/user_profile_eh.php
@@ -45,7 +45,8 @@
protected function OnUpdate(kEvent $event)
{
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
- list ($user_id, $field_values) = each($items_info);
+ $user_id = key($items_info);
+ $field_values = $items_info[$user_id];
if ($user_id != $this->Application->RecallVar('user_id')) {
// we are not updating own profile
Index: core/units/users/users_event_handler.php
===================================================================
--- core/units/users/users_event_handler.php
+++ core/units/users/users_event_handler.php
@@ -664,7 +664,8 @@
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ( $items_info ) {
- list ($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
if ( $id > 0 ) {
$object->Load($id);
@@ -1072,7 +1073,8 @@
{
$event->redirect = false;
$item_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- list($id, $field_values) = each($item_info);
+ $id = key($item_info);
+ $field_values = $item_info[$id];
/** @var kDBItem $object */
$object = $event->getObject( Array ('skip_autoload' => true) );
@@ -1169,7 +1171,8 @@
return;
}
- list ($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
$user_id = $this->Application->RecallVar('user_id');
if ( $id == $user_id && ($user_id > 0 || $user_id == USER_ROOT) ) {
Index: modules/in-commerce/units/coupons/coupons_event_handler.php
===================================================================
--- modules/in-commerce/units/coupons/coupons_event_handler.php
+++ modules/in-commerce/units/coupons/coupons_event_handler.php
@@ -102,7 +102,8 @@
$this->setCloningRequired($object);
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
$object->setID($id);
$object->SetFieldsFromHash($field_values);
$event->setEventParam('form_data', $field_values);
Index: modules/in-commerce/units/orders/orders_event_handler.php
===================================================================
--- modules/in-commerce/units/orders/orders_event_handler.php
+++ modules/in-commerce/units/orders/orders_event_handler.php
@@ -547,7 +547,7 @@
if ( $this->Application->GetVar('same_address') ) {
// copy shipping address to billing
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
$address_fields = Array (
'To', 'Company', 'Phone', 'Fax', 'Email',
@@ -679,7 +679,8 @@
{
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ( $items_info ) {
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
/** @var kDBItem $object */
$object = $event->getObject();
@@ -1533,7 +1534,7 @@
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
if ($items_info) {
// updated address available from SUBMIT -> use it
- list($id, $field_values) = each($items_info);
+ $field_values = current($items_info);
}
else {
// no updated address -> use current address
Index: modules/in-commerce/units/pricing/pricing_event_handler.php
===================================================================
--- modules/in-commerce/units/pricing/pricing_event_handler.php
+++ modules/in-commerce/units/pricing/pricing_event_handler.php
@@ -339,8 +339,7 @@
// sort brackets by 2nd column (Max values)
uasort($temp, 'pr_bracket_comp');
reset($temp);
- $first_item=each($temp);
- $first_item_key=$first_item['key'];
+ $first_item_key = key($temp);
$group_id = $this->Application->getVar('group_id');
Index: modules/in-commerce/units/product_option_combinations/product_option_combinations_event_handler.php
===================================================================
--- modules/in-commerce/units/product_option_combinations/product_option_combinations_event_handler.php
+++ modules/in-commerce/units/product_option_combinations/product_option_combinations_event_handler.php
@@ -178,7 +178,8 @@
return;
}
- list($id, $field_values) = each($items_info);
+ $id = key($items_info);
+ $field_values = $items_info[$id];
$object->setID($id);
$object->SetFieldsFromHash($field_values);
$event->setEventParam('form_data', $field_values);
Index: modules/in-commerce/units/products/products_event_handler.php
===================================================================
--- modules/in-commerce/units/products/products_event_handler.php
+++ modules/in-commerce/units/products/products_event_handler.php
@@ -117,7 +117,7 @@
if ($object->GetDBField('InventoryStatus') == 2) {
// inventory by options (use first selected combination in grid)
$combinations = $this->Application->GetVar('poc_grid');
- list ($combination_id, ) = each($combinations);
+ $combination_id = key($combinations);
}
else {
// inventory by product
Index: modules/in-commerce/units/shipping_quote_engines/usps.php
===================================================================
--- modules/in-commerce/units/shipping_quote_engines/usps.php
+++ modules/in-commerce/units/shipping_quote_engines/usps.php
@@ -706,8 +706,7 @@
reset($this->types);
$allowed_types = explode(", ", MODULE_SHIPPING_USPS_TYPES);
- while (list($key, $value) = each($this->types))
- {
+ foreach ( array_keys($this->types) as $key ) {
if ( !in_array($key, $allowed_types) ) continue;
$request .= '<Package ID="'.$services_count.'">'.
'<Service>'.$key.'</Service>'.
@@ -720,6 +719,7 @@
'</Package>';
$services_count++;
}
+
$request .= '</RateV3Request>';
$api_query = 'RateV3';
}
@@ -1338,4 +1338,4 @@
return $usps_data;
}
-}
\ No newline at end of file
+}
Index: modules/in-commerce/units/taxes/taxes_tag_processor.php
===================================================================
--- modules/in-commerce/units/taxes/taxes_tag_processor.php
+++ modules/in-commerce/units/taxes/taxes_tag_processor.php
@@ -74,7 +74,7 @@
$has_states = $cs_helper->getCountriesWithStates();
if ($selected_country_id && !array_key_exists($selected_country_id, $has_states)) {
- list ($selected_country_id, ) = each($has_states);
+ $selected_country_id = key($has_states);
$this->Application->SetVar('CountrySelector', $selected_country_id);
}
@@ -90,7 +90,7 @@
$this->Application->SetVar('CountrySelector', $selected_country_id);
}
else {
- list ($selected_country_id, ) = each($has_states);
+ $selected_country_id = key($has_states);
$this->Application->SetVar('CountrySelector', $selected_country_id);
}
}
@@ -270,4 +270,4 @@
return $table_name;
}
-}
\ No newline at end of file
+}
Index: modules/in-commerce/units/zones/zones_tag_processor.php
===================================================================
--- modules/in-commerce/units/zones/zones_tag_processor.php
+++ modules/in-commerce/units/zones/zones_tag_processor.php
@@ -73,7 +73,7 @@
$has_states = $cs_helper->getCountriesWithStates();
if ($selected_country_id && !array_key_exists($selected_country_id, $has_states)) {
- list ($selected_country_id, ) = each($has_states);
+ $selected_country_id = key($has_states);
$this->Application->SetVar('CountrySelector', $selected_country_id);
}
@@ -89,7 +89,7 @@
$this->Application->SetVar('CountrySelector', $selected_country_id);
}
else {
- list ($selected_country_id, ) = each($has_states);
+ $selected_country_id = key($has_states);
$this->Application->SetVar('CountrySelector', $selected_country_id);
}
}
@@ -269,4 +269,4 @@
return $table_name;
}
-}
\ No newline at end of file
+}
Index: modules/in-link/units/listings/listings_event_handler.php
===================================================================
--- modules/in-link/units/listings/listings_event_handler.php
+++ modules/in-link/units/listings/listings_event_handler.php
@@ -284,7 +284,8 @@
return false;
}
- list ($link_id, $link_info) = each($l_info);
+ $link_id = key($l_info);
+ $link_info = $l_info[$link_id];
$listing_type_id = $link_info['ListingTypeId'];
$listing_type = $this->Application->recallObject('lst', null, Array('skip_autoload' => true));
@@ -336,7 +337,8 @@
if (!$links_info) return false;
$event->redirect = false;
- list($link_id, $link_info) = each($links_info);
+ $link_id = key($links_info);
+ $link_info = $links_info[$link_id];
$listing_type_id = $link_info['ListingTypeId'];
$new_processing = false;

Event Timeline