$link_param = $tagCode[1];
$href = '';
// Parsing the typolink data. This parsing is roughly done like in tslib_content->typolink()
- if (strstr($link_param, '@')) {
+ // Parse URL:
+ $pU = parse_url($link_param);
+ if (strstr($link_param, '@') && (!$pU['scheme'] || $pU['scheme'] == 'mailto')) {
// mailadr
$href = 'mailto:' . preg_replace('/^mailto:/i', '', $link_param);
} elseif (substr($link_param, 0, 1) == '#') {
} else {
$fileChar = intval(strpos($link_param, '/'));
$urlChar = intval(strpos($link_param, '.'));
- // Parse URL:
- $pU = parse_url($link_param);
// Detects if a file is found in site-root.
list($rootFileDat) = explode('?', $link_param);
$rFD_fI = pathinfo($rootFileDat);
$this->fixture->procOptions = array(
'dontConvBRtoParagraph' => '1',
'preserveDIVSections' => '1',
- 'allowTagsOutside' => 'hr, address'
+ 'allowTagsOutside' => 'hr, address',
+ 'overruleMode' => 'ts_css'
);
}
$this->assertEquals($expectedResult, $this->fixture->TS_transform_db($content, TRUE));
}
-}
+ /**
+ * Data provider for linkWithAtSignCorrectlyTransformedOnWayToRTE
+ */
+ public static function linkWithAtSignCorrectlyTransformedOnWayToRTEProvider() {
+ return array(
+ 'external url with @ sign' => array(
+ '<link http://www.example.org/at@sign>link text</link>',
+ '<p><a href="http://www.example.org/at@sign" data-htmlarea-external="1">link text</a></p>'
+ ),
+ 'email address with @ sign' => array(
+ '<link name@example.org - mail "Opens window for sending email">link text</link>',
+ '<p><a href="mailto:name@example.org" class="mail" title="Opens window for sending email">link text</a></p>'
+ )
+ );
+ }
+ /**
+ * @test
+ * @dataProvider linkWithAtSignCorrectlyTransformedOnWayToRTEProvider
+ */
+ public function linkWithAtSignCorrectlyTransformedOnWayToRTE($content, $expectedResult) {
+ $thisConfig = array('proc.' => $this->fixture->procOptions);
+ $this->assertEquals($expectedResult, $this->fixture->RTE_transform($content, array(), 'rte', $thisConfig));
+ }
+}
?>
\ No newline at end of file