From b5db4fe44261e4641bcda45d36d9249d6939abee Mon Sep 17 00:00:00 2001
From: 4Giedrius <4giedrius@gmail.com>
Date: Mon, 3 Nov 2014 16:22:59 +0200
Subject: [PATCH 1/3] Order fixture updated in order to match newest encryption
function changes
---
tests/fixtures/orders.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/fixtures/orders.xml b/tests/fixtures/orders.xml
index 76027b3bc..2e260b0d8 100644
--- a/tests/fixtures/orders.xml
+++ b/tests/fixtures/orders.xml
@@ -87,5 +87,5 @@
-
+
\ No newline at end of file
From 911d666566047063a6c7104db9a3eb1e9ce89e12 Mon Sep 17 00:00:00 2001
From: Vaidas Lungis
Date: Thu, 6 Nov 2014 10:05:09 +0200
Subject: [PATCH 2/3] Abort decryption if $text variable is null
---
src/bb-library/Box/Crypt.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bb-library/Box/Crypt.php b/src/bb-library/Box/Crypt.php
index 3ec597f05..19640a63a 100644
--- a/src/bb-library/Box/Crypt.php
+++ b/src/bb-library/Box/Crypt.php
@@ -44,6 +44,9 @@ class Box_Crypt implements \Box\InjectionAwareInterface
public function decrypt($text, $pass = null)
{
+ if (is_null($text)){
+ return false;
+ }
$key = $this->_getSalt($pass);
$mode = MCRYPT_MODE_CBC;
$ciphertext_dec = base64_decode($text);
From db6f06a88c5482cd0a18c2d7416e07d367022756 Mon Sep 17 00:00:00 2001
From: Vaidas Lungis
Date: Thu, 6 Nov 2014 10:15:30 +0200
Subject: [PATCH 3/3] domainMatch split into two functions registerDomainMatch
and transferDomainMatch
domain config has two different names to store sld and tld (transfer_sld, register_sld)
fixed Undefined index: register_tld in /srv/boxbilling/src/bb-library/Model/ProductDomainTable.php on line 69
---
src/bb-library/Model/ProductDomainTable.php | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/bb-library/Model/ProductDomainTable.php b/src/bb-library/Model/ProductDomainTable.php
index bfa707f77..640f9c059 100644
--- a/src/bb-library/Model/ProductDomainTable.php
+++ b/src/bb-library/Model/ProductDomainTable.php
@@ -39,14 +39,14 @@ class Model_ProductDomainTable extends Model_ProductTable
if($this->isActionNameSet($item, 'register') &&
$this->isFreeDomainSet($item) &&
- $this->domainMatch($item, $config) )
+ $this->registerDomainMatch($item, $config) )
{
return $this->getProductPrice($product, $config);
}
if($this->isActionNameSet($item, 'transfer') &&
$this->isFreeTransferSet($item) &&
- $this->domainMatch($item, $config) ) {
+ $this->transferDomainMatch($item, $config) ) {
return $this->getProductPrice($product, $config);
}
}
@@ -64,11 +64,22 @@ class Model_ProductDomainTable extends Model_ProductTable
return isset($item['config']['free_domain']) && $item['config']['free_domain'];
}
- private function domainMatch($item, $config)
+ private function registerDomainMatch($item, $config)
{
+ if (!isset($item['config']['domain']['register_sld'])){
+ return false;
+ }
return $item['config']['domain']['register_sld'] == $config['register_sld'] && $item['config']['domain']['register_tld'] == $config['register_tld'];
}
+ private function transferDomainMatch($item, $config)
+ {
+ if (!isset($item['config']['domain']['transfer_sld'])){
+ return false;
+ }
+ return $item['config']['domain']['transfer_sld'] == $config['transfer_sld'] && $item['config']['domain']['transfer_tld'] == $config['transfer_tld'];
+ }
+
private function isFreeTransferSet($item)
{
return isset($item['config']['free_transfer']) && $item['config']['free_transfer'];