V1.3.0 released: Compatible with php 7.x.x
This commit is contained in:
@@ -498,9 +498,9 @@ class AdminControllerCore extends Controller
|
||||
|
||||
// Check if logged on Addons
|
||||
$this->logged_on_addons = false;
|
||||
if (isset($this->context->cookie->username_addons) && isset($this->context->cookie->password_addons) && !empty($this->context->cookie->username_addons) && !empty($this->context->cookie->password_addons)) {
|
||||
$this->logged_on_addons = true;
|
||||
}
|
||||
// if (isset($this->context->cookie->username_addons) && isset($this->context->cookie->password_addons) && !empty($this->context->cookie->username_addons) && !empty($this->context->cookie->password_addons)) {
|
||||
// $this->logged_on_addons = true;
|
||||
// }
|
||||
|
||||
// Set context mode
|
||||
if (defined('_PS_HOST_MODE_') && _PS_HOST_MODE_) {
|
||||
@@ -536,7 +536,7 @@ class AdminControllerCore extends Controller
|
||||
*/
|
||||
public function initBreadcrumbs($tab_id = null, $tabs = null)
|
||||
{
|
||||
if (is_array($tabs) || count($tabs)) {
|
||||
if (is_array($tabs)) {
|
||||
$tabs = array();
|
||||
}
|
||||
|
||||
@@ -1359,7 +1359,7 @@ class AdminControllerCore extends Controller
|
||||
// Check if field is required
|
||||
if ((!Shop::isFeatureActive() && isset($values['required']) && $values['required'])
|
||||
|| (Shop::isFeatureActive() && isset($_POST['multishopOverrideOption'][$field]) && isset($values['required']) && $values['required'])) {
|
||||
if (isset($values['type']) && $values['type'] == 'textLang') {
|
||||
if (isset($values['type']) && in_array($values['type'], array('textLang', 'textareaLang'))) {
|
||||
foreach ($languages as $language) {
|
||||
if (($value = Tools::getValue($field.'_'.$language['id_lang'])) == false && (string)$value != '0') {
|
||||
$this->errors[] = sprintf(Tools::displayError('field %s is required.'), $values['title']);
|
||||
@@ -1371,16 +1371,18 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
|
||||
// Check field validator
|
||||
if (isset($values['type']) && $values['type'] == 'textLang') {
|
||||
if (isset($values['type']) && in_array($values['type'], array('textLang', 'textareaLang'))) {
|
||||
foreach ($languages as $language) {
|
||||
if (Tools::getValue($field.'_'.$language['id_lang']) && isset($values['validation'])) {
|
||||
if (!Validate::$values['validation'](Tools::getValue($field.'_'.$language['id_lang']))) {
|
||||
$values_validation = $values['validation'];
|
||||
if (!Validate::$values_validation(Tools::getValue($field.'_'.$language['id_lang']))) {
|
||||
$this->errors[] = sprintf(Tools::displayError('field %s is invalid.'), $values['title']);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (Tools::getValue($field) && isset($values['validation'])) {
|
||||
if (!Validate::$values['validation'](Tools::getValue($field))) {
|
||||
$values_validation = $values['validation'];
|
||||
if (!Validate::$values_validation(Tools::getValue($field))) {
|
||||
$this->errors[] = sprintf(Tools::displayError('field %s is invalid.'), $values['title']);
|
||||
}
|
||||
}
|
||||
@@ -1930,6 +1932,7 @@ class AdminControllerCore extends Controller
|
||||
'iso_user' => $this->context->language->iso_code,
|
||||
'country_iso_code' => $this->context->country->iso_code,
|
||||
'version' => _PS_VERSION_,
|
||||
'qloapps_version' => _QLOAPPS_VERSION_,
|
||||
'lang_iso' => $this->context->language->iso_code,
|
||||
'full_language_code' => $this->context->language->language_code,
|
||||
'link' => $this->context->link,
|
||||
@@ -2200,6 +2203,7 @@ class AdminControllerCore extends Controller
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'ps_version' => _PS_VERSION_,
|
||||
'qloapps_version' => _QLOAPPS_VERSION_,
|
||||
'timer_start' => $this->timer_start,
|
||||
'iso_is_fr' => strtoupper($this->context->language->iso_code) == 'FR',
|
||||
'modals' => $this->renderModal(),
|
||||
@@ -3244,7 +3248,7 @@ class AdminControllerCore extends Controller
|
||||
$filter_modules_list = array($filter_modules_list);
|
||||
}
|
||||
|
||||
if (!count($filter_modules_list)) {
|
||||
if (is_null($filter_modules_list) || !count($filter_modules_list)) {
|
||||
return false;
|
||||
} //if there is no modules to display just return false;
|
||||
|
||||
@@ -3637,7 +3641,8 @@ class AdminControllerCore extends Controller
|
||||
if (isset($field['validation'])) {
|
||||
$valid_method_exists = method_exists('Validate', $field['validation']);
|
||||
if ((!isset($field['empty']) || !$field['empty'] || (isset($field['empty']) && $field['empty'] && $value)) && $valid_method_exists) {
|
||||
if (!Validate::$field['validation']($value)) {
|
||||
$field_validation = $field['validation'];
|
||||
if (!Validate::$field_validation($value)) {
|
||||
$this->errors[] = Tools::displayError($field['title'].' : Incorrect value');
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user