Skip to content

Commit

Permalink
Adding new rules after audit
Browse files Browse the repository at this point in the history
  • Loading branch information
bbool committed Oct 19, 2022
1 parent 9ad1d11 commit 08521ad
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<FilesMatch "^\.env">
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</FilesMatch>
10 changes: 10 additions & 0 deletions classes/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
10 changes: 10 additions & 0 deletions config/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
10 changes: 10 additions & 0 deletions controllers/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
10 changes: 10 additions & 0 deletions src/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
4 changes: 2 additions & 2 deletions src/OrderStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ private function stateLangAlreadyExists($orderStateId, $langId)
'SELECT id_order_state
FROM `' . _DB_PREFIX_ . self::ORDER_STATE_LANG_TABLE . '`
WHERE
id_order_state = ' . $orderStateId . '
AND id_lang = ' . $langId
id_order_state = ' . (int) $orderStateId . '
AND id_lang = ' . (int) $langId
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Repository/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function findByStates($shopId, array $idStates)
INNER JOIN `' . _DB_PREFIX_ . 'customer` c ON (o.id_customer = c.id_customer)
WHERE o.module = "ps_checkout"
AND o.id_shop = ' . (int) $shopId . '
AND o.current_state IN (' . implode(',', array_keys($idStates)) . ')
AND o.current_state IN (' . implode(', ', array_map('intval', $idStates)) . ')
ORDER BY o.date_add DESC
LIMIT 1000
');
Expand Down
2 changes: 1 addition & 1 deletion src/ValidateOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function validateOrder($payload)
$module->validateOrder(
$payload['cartId'],
(int) $this->getOrderState($psCheckoutCart->paypal_funding),
$payload['amount'],
0,
$fundingSourceTranslationProvider->getPaymentMethodName($psCheckoutCart->paypal_funding),
null,
[
Expand Down

0 comments on commit 08521ad

Please sign in to comment.