Unverified Commit c9e4d041 authored by Oliver Eglseder's avatar Oliver Eglseder
Browse files

[BUGFIX] Make unserialize call PHP5 compliant (fixes #17)

parent bf9d8480
......@@ -182,7 +182,11 @@ abstract class AbstractBackendController extends AbstractController {
'override' => LocalizationUtility::translate('select.editingMode.override', 'lfeditor'),
);
$backendConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['lfeditor'], []);
if (7 === PHP_MAJOR_VERSION) {
$backendConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['lfeditor'], []);
} else {
$backendConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['lfeditor']);
}
if (isset($backendConfiguration['editModeExtension']) && ((int) $backendConfiguration['editModeExtension']) === 0) {
unset($editingModeOptions['extension']);
}
......
......@@ -54,7 +54,15 @@ class LicensingService {
public static function checkKey(): bool {
if (static::$isLicenseKeyValid === NULL) {
static::$isLicenseKeyValid = FALSE;
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY], [FALSE]);
if (7 === PHP_MAJOR_VERSION) {
$configuration = unserialize(
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY],
[false]
);
} else {
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY]);
}
if (isset($configuration['key']) && $key = trim($configuration['key'])) {
static::$isLicenseKeyValid = (bool) preg_match('/^([A-Z\d]{6}-?){4}$/', $key);
}
......@@ -71,7 +79,14 @@ class LicensingService {
*/
public static function ping($returnUrl = FALSE): string {
try {
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY], [FALSE]);
if (7 === PHP_MAJOR_VERSION) {
$configuration = unserialize(
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY],
[false]
);
} else {
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::EXTENSION_KEY]);
}
$key = '';
if (isset($configuration['key'])) {
$key = trim($configuration['key']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment