Project

General

Profile

Bug #15095 » bug_1655_makeredirect_useHTTPS_v2_w.diff

Administrator Admin, 2006-08-23 14:31

View differences:

t3lib/class.t3lib_div.php 2006-08-23 14:22:50.000000000 +0200
TYPO3_HOST_ONLY = [host] = 192.168.1.4
TYPO3_PORT = [port] = 8080 (blank if 80, taken from host value)
TYPO3_REQUEST_HOST = [scheme]://[host][:[port]]
TYPO3_REQUEST_URL = [scheme]://[host][:[port]][path]?[query] (sheme will by default be 'http' until we can detect if it's https -
TYPO3_REQUEST_URL = [scheme]://[host][:[port]][path]?[query] (scheme will by default be "http" until we can detect something different)
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 frontend
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)
TYPO3_SSL = Returns TRUE if this session uses SSL (HTTPS)
Notice: [fragment] is apparently NEVER available to the script!
......
*/
function substUrlsInPlainText($message,$urlmode='76',$index_script_url='') {
// Substitute URLs with shorter links:
$urlSplit=explode('http://',$message);
$urlSplit = preg_split('|http[s]?://|',$message);
reset($urlSplit);
while(list($c,$v)=each($urlSplit)) {
if ($c) {
$newParts = preg_split('/\s|[<>"{}|\\\^`()\']/', $v, 2);
$newURL='http://'.$newParts[0];
$newURL = (t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://') . $newParts[0];
switch((string)$urlmode) {
case 'all':
$newURL=t3lib_div::makeRedirectUrl($newURL,0,$index_script_url);
(2-2/2)