http\typo3\sysext\cms\tslib\class.tslib_content.php .. 4806 4807 4808 4809 4810 4811 4812 .. 4814 4815 4816 4817 4818 4819 4820 4821 .. 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 .. 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 .. 4868 4869 4870 4871 4872 4873 4874 .. 4806 4807 4808 4809 4810 4811 4812 .. 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 .. 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 .. 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 .. 4884 4885 4886 4887 4888 4889 4890 @@ -4806,7 +4806,7 @@ class tslib_cObj { /** * Finds URLS in text and makes it to a real link. - * Will find all strings prefixed with "http://" in the $data string and make them into a link, linking to the URL we should have found. + * Will find all strings prefixed with "http://" OR "https://" in the $data string and make them into a link, linking to the URL we should have found. * * @param string The string in which to search for "http://" * @param array Configuration for makeLinks, see link @@ -4814,8 +4814,24 @@ class tslib_cObj { * @see _parseFunc() */ function http_makelinks($data, $conf) { + $datastep1 = $this->http_makelinks_sub($data, $conf ,"http://") ; + return $this->http_makelinks_sub( $datastep1, $conf ,"https://") ; + + } + /** + * subfunction to http_makelinks: Finds URLS in text and makes it to a real link. + * Will find all strings prefixed with given $scheme in the $data string and make them into a link, linking to the URL we should have found. + * + * @param string The string in which to search for $sheme + * @param array Configuration for makeLinks, see link + * @param string scheme: "http://" or "https://" + * @return string The processed input string, being returned. + * @see _parseFunc() + */ + function http_makelinks_sub($data, $conf ,$scheme) { $aTagParams = $this->getATagParams($conf); - $textpieces = explode('http://', $data); + $textpieces = explode($scheme, $data); + $pieces = count($textpieces); $textstr = $textpieces[0]; $initP = '?id=' . $GLOBALS['TSFE']->id . '&type=' . $GLOBALS['TSFE']->type; @@ -4833,10 +4849,10 @@ class tslib_cObj { $parts[1] = substr($textpieces[$i], $len); $keep = $conf['keep']; - $linkParts = parse_url('http://' . $parts[0]); + $linkParts = parse_url($scheme . $parts[0]); $linktxt = ''; if (strstr($keep, 'scheme')) { - $linktxt = 'http://'; + $linktxt = $scheme ; } $linktxt .= $linkParts['host']; if (strstr($keep, 'path')) { @@ -4849,13 +4865,13 @@ class tslib_cObj { } $target = isset($conf['extTarget']) ? $conf['extTarget'] : $GLOBALS['TSFE']->extTarget; if ($GLOBALS['TSFE']->config['config']['jumpurl_enable']) { - $jumpurl = 'http://' . $parts[0]; + $jumpurl = $scheme . $parts[0]; $juHash = t3lib_div::hmac($jumpurl, 'jumpurl'); $res = 'extLinkATagParams(('http://' . $parts[0]), 'url') . '>'; } else { - $res = 'extLinkATagParams('http://' . $parts[0], 'url') . + $aTagParams . $this->extLinkATagParams( $sheme . $parts[0], 'url') . '>'; } $wrap = isset($conf['wrap.']) @@ -4868,7 +4884,7 @@ class tslib_cObj { } $textstr .= $res . $parts[1]; } else { - $textstr .= 'http://' . $textpieces[$i]; + $textstr .= $scheme . $textpieces[$i]; } } return $textstr;