Fixed bug 4758: Page with doktype 3 (external URL) and e-mail as URL could be shown...
authorOliver Hader <oliver.hader@typo3.org>
Mon, 5 Feb 2007 21:02:09 +0000 (21:02 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 5 Feb 2007 21:02:09 +0000 (21:02 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1998 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php
typo3/sysext/cms/tslib/class.tslib_menu.php

index e7bafc3..9080084 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 2007-02-05  Oliver Hader  <oh@inpublica.de>
 
        * Bugfix for TSconfig overriding TCA field configuration
+       * Fixed bug 4758: Page with doktype 3 (external URL) and e-mail as URL could be shown directly
 
 2007-02-04  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
index e9efcca..2efb77b 100755 (executable)
@@ -4011,7 +4011,7 @@ class t3lib_div {
         * Usage: 447
         *
         * @param       string          Class name to instantiate
-        * @return      object          The object
+        * @return      object          A reference to the object
         */
        function &makeInstance($className)      {
 
index 2f9c6a8..1a7cb14 100755 (executable)
@@ -151,7 +151,7 @@ class tslib_menu {
        var $imgNamePrefix = 'img';
        var $imgNameNotRandom=0;
        var $debug = 0;
-       var $parent_cObj ='';                           // Loaded with the parent cObj-object when a new HMENU is made
+       var $parent_cObj;                               // Loaded with the parent cObj-object when a new HMENU is made
        var $GMENU_fixKey='gmenu';
        var $MP_array=array();                          // accumulation of mount point data
 
@@ -1172,6 +1172,13 @@ class tslib_menu {
                        $LD = $this->tmpl->linkData($this->menuArr[$key],$mainTarget,'','',$overrideArray, $this->mconf['addParams'].$MP_params.$this->menuArr[$key]['_ADD_GETVARS'], $typeOverride);
                }
 
+                       // Override URL if using "External URL" as doktype with a valid e-mail address:
+               if ($this->menuArr[$key]['doktype'] == 3 && $this->menuArr[$key]['urltype'] == 3 && t3lib_div::validEmail($this->menuArr[$key]['url'])) {
+                               // Create mailto-link using tslib_cObj::typolink (concerning spamProtectEmailAddresses):
+                       $LD['totalURL'] = $this->parent_cObj->typoLink_URL(array('parameter' => $this->menuArr[$key]['url']));
+                       $LD['target'] = '';
+               }
+
                        // Manipulation in case of access restricted pages:
                $this->changeLinksForAccessRestrictedPages($LD,$this->menuArr[$key],$mainTarget,$typeOverride);
 
@@ -1252,6 +1259,7 @@ class tslib_menu {
                        }
 
                                // especially scripts that build the submenu needs the parent data
+                       $submenu->parent_cObj = &$this->parent_cObj;
                        $submenu->parentMenuArr = $this->menuArr;
 
                                // Setting alternativeMenuTempArray (will be effective only if an array)