Commit de1cbf75 authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Changed the way simulateStaticDocuments are resolved


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@164 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 61d9dffb
2004-03-31 Kasper Skårhøj,,, <kasper@typo3.com>
* Changed the way simulateStaticDocuments are resolved
2004-03-28 Kasper Skårhøj,,, <kasper@typo3.com>
* Changed "t3lib_div::calluserFunc" and t3lib_div::getUserObj to use "&" as token for persistent (global) objects rather than ">" - PLEASE UPDATE YOUR CODE if you happend to use these features already (less than a week old).
......
......@@ -2453,6 +2453,7 @@ class t3lib_div {
TYPO3_REQUEST_SCRIPT = [scheme]://[host][:[port]][path_script]
TYPO3_REQUEST_DIR = [scheme]://[host][:[port]][path_dir]
TYPO3_SITE_URL = [scheme]://[host][:[port]][path_dir] of the TYPO3 website
TYPO3_SITE_SCRIPT = [script / Speaking URL] of the TYPO3 website
TYPO3_DOCUMENT_ROOT = Absolute path of root of documents: TYPO3_DOCUMENT_ROOT.SCRIPT_NAME = SCRIPT_FILENAME (typically)
Notice: [fragment] is apparently NEVER available to the script!
......@@ -2544,7 +2545,9 @@ class t3lib_div {
if (substr($siteUrl,-1)!='/') $siteUrl.='/';
return $siteUrl;
} else return '';
break;
case 'TYPO3_SITE_SCRIPT':
return substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
break;
case '_ARRAY':
$out = array();
......@@ -2562,6 +2565,7 @@ class t3lib_div {
TYPO3_REQUEST_SCRIPT,
TYPO3_REQUEST_DIR,
TYPO3_SITE_URL,
TYPO3_SITE_SCRIPT,
SCRIPT_NAME,
TYPO3_DOCUMENT_ROOT,
SCRIPT_FILENAME,
......
......@@ -187,12 +187,13 @@
var $page=''; // The pagerecord (array)
var $contentPid=0; // This will normally point to the same value as id, but can be changed to point to another page from which content will then be displayed instead.
var $sys_page=''; // The object with pagefunctions (object)
var $jumpurl='';
var $jumpurl='';
var $pageNotFound=0; // Is set to 1 if a pageNotFound handler could have been called.
var $domainStartPage=0; // Domain start page
var $MP='';
var $RDCT='';
var $page_cache_reg1=0; // This can be set from applications as a way to tag cached versions of a page and later perform some external cache management, like clearing only a part of the cache of a page...
var $siteScript=''; // Contains the value of the current script path that activated the frontend. Typically "index.php" but by rewrite rules it could be something else! Used for Speaking Urls / Simulate Static Documents.
// USER
var $fe_user=''; // The user (object)
......@@ -491,25 +492,25 @@
global $TYPO3_CONF_VARS;
# IF (TYPO3_OS=='WIN') return; # Commenting out this line will make it work for windows Apache mod_rewrite as well.
// Redirect by mod_rewrite:
if ($GLOBALS['HTTP_SERVER_VARS']['REDIRECT_URL']) { // If there has been a redirect (basically; we arrived here otherwise than via "index.php" in the URL) this can happend either due to a CGI-script or because of reWrite rule.
$uParts = parse_url($GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']);
$requestFilename = trim(ereg_replace('.*\/','',$uParts['path'])); // This is the filename of the script/simulated html-file.
if ($requestFilename && substr($requestFilename,-4)!='.php') {
$parts = explode('.',ereg_replace('.*\/','',$requestFilename));
$this->siteScript = t3lib_div::getIndpEnv('TYPO3_SITE_SCRIPT');
// Resolving of "simulateStaticDocuments" URLs:
if ($this->siteScript && substr($this->siteScript,0,9)!='index.php') { // If there has been a redirect (basically; we arrived here otherwise than via "index.php" in the URL) this can happend either due to a CGI-script or because of reWrite rule. Earlier we used $GLOBALS['HTTP_SERVER_VARS']['REDIRECT_URL'] to check but
$uParts = parse_url($this->siteScript); // Parse the path:
$requestFilename = basename($uParts['path']); // This is the filename of the script/simulated html-file.
if (dirname($uParts['path'])=='.' && $requestFilename && substr($requestFilename,-5)=='.html') {
$parts = explode('.',$requestFilename);
$pCount = count($parts);
if ($parts[$pCount-1]='html') {
if ($pCount>2) {
$this->type = intval($parts[$pCount-2]);
$this->id = $parts[$pCount-3];
} else {
$this->type = 0;
$this->id = $parts[0];
}
if ($pCount>2) {
$this->type = intval($parts[$pCount-2]);
$this->id = $parts[$pCount-3];
} else {
$this->type = 0;
$this->id = $parts[0];
}
}
}
// If PATH_INFO
if (t3lib_div::getIndpEnv('PATH_INFO')) { // If pathinfo contains stuff...
$parts=t3lib_div::trimExplode('/',t3lib_div::getIndpEnv('PATH_INFO'),1);
......@@ -533,7 +534,7 @@
}
}
}
/**
* Clears the preview-flags, sets sim_exec_time to current time.
* Hidden pages must be hidden as default, $GLOBALS['SIM_EXEC_TIME'] is set to $GLOBALS['EXEC_TIME'] in t3lib/config_default.inc. Alter it by adding or subtracting seconds.
......
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