Commit 714ecb3e authored by Carsten  Rose's avatar Carsten Rose
Browse files

Cookie Sitepath: wrong detected in case of API calls.

parent 0a7e2917
Pipeline #803 passed with stage
in 1 minute and 45 seconds
......@@ -98,8 +98,15 @@ class Config {
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][EXT_KEY])) {
$configT3qfq = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][EXT_KEY]);
} else {
$all = include_once($pathTypo3Conf . '/' . CONFIG_T3);
$all = include($pathTypo3Conf . '/' . CONFIG_T3);
if(empty($all) || $all===true){
throw new qfq\UserFormException ("Error read file: " . $pathTypo3Conf . '/' . CONFIG_T3, ERROR_IO_READ_FILE);
}
$configT3qfq = unserialize($all['EXT']['extConf'][EXT_KEY]);
if(!is_array($configT3qfq)){
throw new qfq\UserFormException ("Error read file: " . $pathTypo3Conf . '/' . CONFIG_T3, ERROR_IO_READ_FILE);
}
unset($all);
}
$configIni = $pathTypo3Conf . '/' . CONFIG_QFQ_INI;
......
......@@ -42,6 +42,7 @@ class Session {
$lifetime = 86400; // one day
$path = $this->getSitePath();
session_set_cookie_params($lifetime, $path);
$currentCookieParams = session_get_cookie_params();
......@@ -83,9 +84,9 @@ class Session {
$path = substr($path, 0, $pos + 1);
// QFQ might be called by API - justify to the SitePath
$pos = strpos($path, 'typo3conf/ext/qfq/api');
$pos = strpos($path, 'typo3conf/');
if ($pos !== false) {
$path = substr($path, 0, $pos);
$path = substr($path, 0, $pos - strlen($path));
}
if (empty($path)) {
......
Supports Markdown
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