Permalink
Browse files

Merge branch 'master' of git://github.com/osCommerce/oscommerce

  • Loading branch information...
2 parents 70bb24a + ebbc924 commit 91fd02735408b521e53b8818d9da3e347f50450e @tgely committed Apr 7, 2011
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\Administrators\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\Configuration\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\Configuration\EntryGet', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -26,8 +26,8 @@ public static function execute($key = null) {
if ( $phar_can_open === true ) {
$result = $phar->getMetadata();
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\Countries\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\CreditCards\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\Currencies\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\Languages\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -19,7 +19,7 @@ public static function execute($data) {
$OSCOM_PDO->beginTransaction();
- if ( $data['id'] !== false ) {
+ if ( isset($data['id']) ) {
$add_category_and_product_placeholders = false;
$Qlanguage = $OSCOM_PDO->prepare('update :table_languages set name = :name, code = :code, locale = :locale, charset = :charset, date_format_short = :date_format_short, date_format_long = :date_format_long, time_format = :time_format, text_direction = :text_direction, currencies_id = :currencies_id, numeric_separator_decimal = :numeric_separator_decimal, numeric_separator_thousands = :numeric_separator_thousands, parent_id = :parent_id where languages_id = :languages_id');
@@ -45,7 +45,7 @@ public static function execute($data) {
if ( $Qlanguage->isError() ) {
$error = true;
} else {
- if ( $data['id'] === false ) {
+ if ( !isset($data['id']) ) {
$data['id'] = $OSCOM_PDO->lastInsertId();
}
@@ -150,12 +150,13 @@ public static function execute($data) {
}
if ( $error === false ) {
- $Qattributes = $OSCOM_PDO->prepare('select products_id, value from :table_product_attributes where languages_id = :languages_id');
+ $Qattributes = $OSCOM_PDO->prepare('select id, products_id, value from :table_product_attributes where languages_id = :languages_id');
$Qattributes->bindInt(':languages_id', $data['default_language_id']);
$Qattributes->execute();
while ( $Qattributes->fetch() ) {
- $Qinsert = $OSCOM_PDO->prepare('insert into :table_product_attributes (products_id, languages_id, value) values (:products_id, :languages_id, :value)');
+ $Qinsert = $OSCOM_PDO->prepare('insert into :table_product_attributes (id, products_id, languages_id, value) values (:id, :products_id, :languages_id, :value)');
+ $Qinsert->bindInt(':id', $Qattributes->valueInt('id'));
$Qinsert->bindInt(':products_id', $Qattributes->valueInt('products_id'));
$Qinsert->bindInt(':languages_id', $data['id']);
$Qinsert->bindValue(':value', $Qattributes->value('value'));
@@ -16,8 +16,8 @@ public static function execute($username, $key = null) {
$result = OSCOM::callDB('Admin\Login\GetAdmin', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\TaxClasses\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\TaxClasses\EntryGet', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -16,8 +16,8 @@ public static function execute($id, $key = null) {
$result = OSCOM::callDB('Admin\ZoneGroups\Get', $data);
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -24,8 +24,8 @@ public static function execute($id, $key = null) {
$result['zone_name'] = OSCOM::getDef('all_zones');
}
- if ( !empty($key) && isset($result[$key]) ) {
- $result = $result[$key];
+ if ( isset($key) ) {
+ $result = $result[$key] ?: null;
}
return $result;
@@ -65,7 +65,7 @@ public function loadIniFile($filename = null, $comment = '#', $language_code = n
$ini_array[$key] = $value;
} elseif ( isset($key) ) {
- $ini_array[$key] .= trim($line);
+ $ini_array[$key] .= "\n" . trim($line);
}
}
}
@@ -1 +1 @@
-3.0
+3.0.1

0 comments on commit 91fd027

Please sign in to comment.