Skip to content

Commit 5608eb2

Browse files
Merge pull request #5 from MichaelRotaru/master
Fix: Activate key validation only for paylike module
2 parents 2aeebb6 + 2823256 commit 5608eb2

File tree

6 files changed

+66
-48
lines changed

6 files changed

+66
-48
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2-
/* Initialize errors object */
3-
require_once('helpers/Paylike_Errors.php');
4-
$errorHandler = new PaylikeErrors();
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
/* Initialize errors object */
4+
require_once('helpers/Paylike_Errors.php');
5+
$errorHandler = new PaylikeErrors();
6+
}

upload/admin/includes/modules/payment/paylike/validate.php

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<?php
2-
require_once('vendor/autoload.php');
3-
require_once('helpers/Paylike_Keys_Validator.php');
4-
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
2+
$validation_keys = array();
3+
$errors = array();
4+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
5+
require_once('vendor/autoload.php');
6+
require_once('helpers/Paylike_Keys_Validator.php');
7+
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
58

6-
/* Module keys that needs to be validated */
7-
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
8-
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
9-
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
10-
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
11-
);
9+
/* Module keys that needs to be validated */
10+
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
11+
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
12+
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
13+
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
14+
);
1215

13-
$errors = validate($HTTP_POST_VARS['configuration']);
14-
/* In case of errors, write them into cookies */
15-
if (isset($errorHandler)) {
16-
$errorHandler->setCookieErrors($errors);
16+
$errors = validate($HTTP_POST_VARS['configuration']);
17+
/* In case of errors, write them into cookies */
18+
if (isset($errorHandler)) {
19+
$errorHandler->setCookieErrors($errors);
20+
}
1721
}
1822

1923
/* Validate module keys */
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2-
/* Initialize errors object */
3-
require_once('helpers/Paylike_Errors.php');
4-
$errorHandler = new PaylikeErrors();
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
/* Initialize errors object */
4+
require_once('helpers/Paylike_Errors.php');
5+
$errorHandler = new PaylikeErrors();
6+
}

upload_CE-Phoenix-2341-Frozen/admin/includes/modules/payment/paylike/validate.php

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<?php
2-
require_once('vendor/autoload.php');
3-
require_once('helpers/Paylike_Keys_Validator.php');
4-
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
2+
$validation_keys = array();
3+
$errors = array();
4+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
5+
require_once('vendor/autoload.php');
6+
require_once('helpers/Paylike_Keys_Validator.php');
7+
require_once($module_language_directory . $language . '/modules/payment/paylike.php');
58

6-
/* Module keys that needs to be validated */
7-
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
8-
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
9-
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
10-
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
11-
);
9+
/* Module keys that needs to be validated */
10+
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
11+
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
12+
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
13+
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
14+
);
1215

13-
$errors = validate($HTTP_POST_VARS['configuration']);
14-
/* In case of errors, write them into cookies */
15-
if (isset($errorHandler)) {
16-
$errorHandler->setCookieErrors($errors);
16+
$errors = validate($HTTP_POST_VARS['configuration']);
17+
/* In case of errors, write them into cookies */
18+
if (isset($errorHandler)) {
19+
$errorHandler->setCookieErrors($errors);
20+
}
1721
}
1822

1923
/* Validate module keys */
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2-
/* Initialize errors object */
3-
require_once('helpers/Paylike_Errors.php');
4-
$errorHandler = new PaylikeErrors();
2+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
3+
/* Initialize errors object */
4+
require_once('helpers/Paylike_Errors.php');
5+
$errorHandler = new PaylikeErrors();
6+
}

upload_ce_phoenix/admin/includes/modules/payment/paylike/validate.php

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<?php
2-
require_once('vendor/autoload.php');
3-
require_once('helpers/Paylike_Keys_Validator.php');
4-
require_once('../includes/languages/' . $language . '/modules/payment/paylike.php');
2+
$validation_keys = array();
3+
$errors = array();
4+
if(strpos($_SERVER['REQUEST_URI'], 'module=paylike')){
5+
require_once('vendor/autoload.php');
6+
require_once('helpers/Paylike_Keys_Validator.php');
7+
require_once('../includes/languages/' . $language . '/modules/payment/paylike.php');
58

6-
/* Module keys that needs to be validated */
7-
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
8-
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
9-
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
10-
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
11-
);
9+
/* Module keys that needs to be validated */
10+
$validation_keys = array('LIVE_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_APP_KEY',
11+
'LIVE_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_KEY',
12+
'TEST_APP_KEY' =>'MODULE_PAYMENT_PAYLIKE_TEST_APP_KEY',
13+
'TEST_PUBLIC_KEY'=>'MODULE_PAYMENT_PAYLIKE_TEST_KEY',
14+
);
1215

13-
$errors = validate($_POST['configuration']);
14-
/* In case of errors, write them into cookies */
15-
if (isset($errorHandler)) {
16-
$errorHandler->setCookieErrors($errors);
16+
$errors = validate($_POST['configuration']);
17+
/* In case of errors, write them into cookies */
18+
if (isset($errorHandler)) {
19+
$errorHandler->setCookieErrors($errors);
20+
}
1721
}
1822

1923
/* Validate module keys */

0 commit comments

Comments
 (0)