Code Duplication    Length = 14-14 lines in 3 locations

typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php 1 location

@@ 1110-1123 (lines=14) @@
1107
     * @return string Link-Wrapped $code value, if $testString was URL or email.
1108
     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10
1109
     */
1110
    public function linkUrlMail($code, $testString)
1111
    {
1112
        // Check for URL:
1113
        $scheme = parse_url($testString, PHP_URL_SCHEME);
1114
        if ($scheme === 'http' || $scheme === 'https' || $scheme === 'ftp') {
1115
            return '<a href="' . htmlspecialchars($testString) . '" target="_blank">' . $code . '</a>';
1116
        }
1117
        // Check for email:
1118
        if (GeneralUtility::validEmail($testString)) {
1119
            return '<a href="mailto:' . htmlspecialchars($testString) . '" target="_blank">' . $code . '</a>';
1120
        }
1121
        // Return if nothing else...
1122
        return $code;
1123
    }
1124
1125
    /**
1126
     * Creates the URL to this script, including all relevant GPvars

typo3/sysext/backend/Classes/View/PageLayoutView.php 1 location

@@ 3700-3713 (lines=14) @@
3697
     * @param string $testString String which is tested for being a URL or email and which will be used for the link if so.
3698
     * @return string Link-Wrapped $code value, if $testString was URL or email.
3699
     */
3700
    public function linkUrlMail($code, $testString)
3701
    {
3702
        // Check for URL:
3703
        $scheme = parse_url($testString, PHP_URL_SCHEME);
3704
        if ($scheme === 'http' || $scheme === 'https' || $scheme === 'ftp') {
3705
            return '<a href="' . htmlspecialchars($testString) . '" target="_blank">' . $code . '</a>';
3706
        }
3707
        // Check for email:
3708
        if (GeneralUtility::validEmail($testString)) {
3709
            return '<a href="mailto:' . htmlspecialchars($testString) . '" target="_blank">' . $code . '</a>';
3710
        }
3711
        // Return if nothing else...
3712
        return $code;
3713
    }
3714
3715
    /**
3716
     * Creates the URL to this script, including all relevant GPvars

typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php 1 location

@@ 3570-3583 (lines=14) @@
3567
     * @param string $testString String which is tested for being a URL or email and which will be used for the link if so.
3568
     * @return string Link-Wrapped $code value, if $testString was URL or email.
3569
     */
3570
    public function linkUrlMail($code, $testString)
3571
    {
3572
        // Check for URL:
3573
        $scheme = parse_url($testString, PHP_URL_SCHEME);
3574
        if ($scheme === 'http' || $scheme === 'https' || $scheme === 'ftp') {
3575
            return '<a href="' . htmlspecialchars($testString) . '" target="_blank">' . $code . '</a>';
3576
        }
3577
        // Check for email:
3578
        if (GeneralUtility::validEmail($testString)) {
3579
            return '<a href="mailto:' . htmlspecialchars($testString) . '" target="_blank">' . $code . '</a>';
3580
        }
3581
        // Return if nothing else...
3582
        return $code;
3583
    }
3584
3585
    /**
3586
     * Creates the URL to this script, including all relevant GPvars