fixed rewriting, added further debug infos
Dieser Commit ist enthalten in:
Ursprung
e11792f616
Commit
d53c559871
4 geänderte Dateien mit 30 neuen und 21 gelöschten Zeilen
|
@ -53,6 +53,7 @@ class ModRewrite extends ModRewriteBase {
|
||||||
*/
|
*/
|
||||||
public static function initialize($clientId) {
|
public static function initialize($clientId) {
|
||||||
mr_loadConfiguration($clientId, true);
|
mr_loadConfiguration($clientId, true);
|
||||||
|
parent::initialize();
|
||||||
self::$_db = new DB_Contenido();
|
self::$_db = new DB_Contenido();
|
||||||
self::$_lookupTable = array();
|
self::$_lookupTable = array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -494,8 +494,6 @@ class ModRewriteController extends ModRewriteBase {
|
||||||
// load_client is set in frontend/config.php
|
// load_client is set in frontend/config.php
|
||||||
$lang = (int) $load_lang;
|
$lang = (int) $load_lang;
|
||||||
} else {
|
} else {
|
||||||
// get client id from table
|
|
||||||
cInclude('classes', 'contenido/class.clientslang.php');
|
|
||||||
$clCol = new cApiClientLanguageCollection();
|
$clCol = new cApiClientLanguageCollection();
|
||||||
$clCol->setWhere('idclient', $client);
|
$clCol->setWhere('idclient', $client);
|
||||||
$clCol->query();
|
$clCol->query();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AMR url stack class
|
* AMR url stack class
|
||||||
*
|
*
|
||||||
|
@ -12,7 +13,6 @@
|
||||||
* @link http://www.4fb.de
|
* @link http://www.4fb.de
|
||||||
* @link http://www.contenido.org
|
* @link http://www.contenido.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('CON_FRAMEWORK')) {
|
if (!defined('CON_FRAMEWORK')) {
|
||||||
die('Illegal call');
|
die('Illegal call');
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class ModRewriteUrlStack {
|
||||||
|
|
||||||
$sStackId = $this->_aUrls[$url];
|
$sStackId = $this->_aUrls[$url];
|
||||||
if (!isset($this->_aStack[$sStackId]['urlpath'])) {
|
if (!isset($this->_aStack[$sStackId]['urlpath'])) {
|
||||||
$this->_chunkSetPrettyUrlParts();
|
$this->_chunkSetPrettyUrlParts($sStackId);
|
||||||
}
|
}
|
||||||
$aPretty = array(
|
$aPretty = array(
|
||||||
'urlpath' => $this->_aStack[$sStackId]['urlpath'],
|
'urlpath' => $this->_aStack[$sStackId]['urlpath'],
|
||||||
|
@ -233,8 +233,11 @@ class ModRewriteUrlStack {
|
||||||
*
|
*
|
||||||
* Composes the query by looping thru stored but non processed urls, executes
|
* Composes the query by looping thru stored but non processed urls, executes
|
||||||
* the query and adds the (urlpath and urlname) result to the stack.
|
* the query and adds the (urlpath and urlname) result to the stack.
|
||||||
|
*
|
||||||
|
* @param type $sStackId
|
||||||
|
* @return type
|
||||||
*/
|
*/
|
||||||
private function _chunkSetPrettyUrlParts() {
|
private function _chunkSetPrettyUrlParts($sStackId) {
|
||||||
// collect stack parameter to get urlpath and urlname
|
// collect stack parameter to get urlpath and urlname
|
||||||
$aStack = array();
|
$aStack = array();
|
||||||
foreach ($this->_aStack as $stackId => $item) {
|
foreach ($this->_aStack as $stackId => $item) {
|
||||||
|
@ -247,23 +250,26 @@ class ModRewriteUrlStack {
|
||||||
// now, it's time to compose the where clause of the query
|
// now, it's time to compose the where clause of the query
|
||||||
$sWhere = '';
|
$sWhere = '';
|
||||||
foreach ($aStack as $stackId => $item) {
|
foreach ($aStack as $stackId => $item) {
|
||||||
$aP = $item['params'];
|
|
||||||
if ((int) mr_arrayValue($aP, 'idart') > 0) {
|
if ($stackId == $sStackId) {
|
||||||
$sWhere .= '(al.idart = ' . $aP['idart'] . ' AND al.idlang = ' . $aP['lang'] . ') OR ';
|
$aP = $item['params'];
|
||||||
} elseif ((int) mr_arrayValue($aP, 'idartlang') > 0) {
|
if ((int) mr_arrayValue($aP, 'idart') > 0) {
|
||||||
$sWhere .= '(al.idartlang = ' . $aP['idartlang'] . ') OR ';
|
$sWhere .= '(al.idart = ' . $aP['idart'] . ' AND al.idlang = ' . $aP['lang'] . ') OR ';
|
||||||
} elseif ((int) mr_arrayValue($aP, 'idcat') > 0) {
|
} elseif ((int) mr_arrayValue($aP, 'idartlang') > 0) {
|
||||||
$sWhere .= '(cl.idcat = ' . $aP['idcat'] . ' AND cl.idlang = ' . $aP['lang'] . ' AND cl.startidartlang = al.idartlang) OR ';
|
$sWhere .= '(al.idartlang = ' . $aP['idartlang'] . ') OR ';
|
||||||
} elseif ((int) mr_arrayValue($aP, 'idcatart') > 0) {
|
} elseif ((int) mr_arrayValue($aP, 'idcat') > 0) {
|
||||||
$sWhere .= '(ca.idcatart = ' . $aP['idcatart'] . ' AND ca.idart = al.idart AND al.idlang = ' . $aP['lang'] . ') OR ';
|
$sWhere .= '(cl.idcat = ' . $aP['idcat'] . ' AND cl.idlang = ' . $aP['lang'] . ' AND cl.startidartlang = al.idartlang) OR ';
|
||||||
} elseif ((int) mr_arrayValue($aP, 'idcatlang') > 0) {
|
} elseif ((int) mr_arrayValue($aP, 'idcatart') > 0) {
|
||||||
$sWhere .= '(cl.idcatlang = ' . $aP['idcatlang'] . ' AND cl.startidartlang = al.idartlang) OR ';
|
$sWhere .= '(ca.idcatart = ' . $aP['idcatart'] . ' AND ca.idart = al.idart AND al.idlang = ' . $aP['lang'] . ') OR ';
|
||||||
|
} elseif ((int) mr_arrayValue($aP, 'idcatlang') > 0) {
|
||||||
|
$sWhere .= '(cl.idcatlang = ' . $aP['idcatlang'] . ' AND cl.startidartlang = al.idartlang) OR ';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($sWhere == '') {
|
if ($sWhere == '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$sWhere = substr($sWhere, 0, -4);
|
$sWhere = cString::getPartOfString($sWhere, 0, -4);
|
||||||
$sWhere = str_replace(' OR ', " OR \n", $sWhere);
|
$sWhere = str_replace(' OR ', " OR \n", $sWhere);
|
||||||
|
|
||||||
// compose query and execute it
|
// compose query and execute it
|
||||||
|
|
|
@ -27,7 +27,7 @@ if (!defined('CON_FRAMEWORK')) {
|
||||||
die('Illegal call');
|
die('Illegal call');
|
||||||
}
|
}
|
||||||
|
|
||||||
cInclude('classes', 'contenido/class.articlelanguage.php');
|
global $_cecRegistry, $cfg, $contenido, $area, $client, $load_client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes cl-mod-rewrite related job for created new tree.
|
* Processes cl-mod-rewrite related job for created new tree.
|
||||||
|
@ -485,10 +485,14 @@ function mr_buildGeneratedCode($code) {
|
||||||
|
|
||||||
// remove tinymce single quote entities:
|
// remove tinymce single quote entities:
|
||||||
$code = str_replace("'", "'", $code);
|
$code = str_replace("'", "'", $code);
|
||||||
|
|
||||||
|
$baseUri = cRegistry::getFrontendUrl();
|
||||||
|
$baseUri = CEC_Hook::execute("Contenido.Frontend.BaseHrefGeneration", $baseUri);
|
||||||
|
|
||||||
// get base uri
|
// CON-1389 modifier /e is deprecated as of PHP 5.5
|
||||||
$sBaseUri = $cfgClient[$client]['path']['htmlpath'];
|
$code = preg_replace_callback("/([\"|\'|=])upload\/(.?|.+?)([\"|\'|>])/i", function($match) use ($baseUri) {
|
||||||
$sBaseUri = CEC_Hook::execute("Contenido.Frontend.BaseHrefGeneration", $sBaseUri);
|
return stripslashes($match[1] . $baseUri . 'upload/' . $match[2] . $match[3]);
|
||||||
|
}, $code);
|
||||||
|
|
||||||
// define some preparations to replace /front_content.php & ./front_content.php
|
// define some preparations to replace /front_content.php & ./front_content.php
|
||||||
// against front_content.php, because urls should start with front_content.php
|
// against front_content.php, because urls should start with front_content.php
|
||||||
|
|
Laden …
In neuem Issue referenzieren