Bug #53862 » fu_idna_4.7.patch

patch for 4.7 branch - Michiel Roos, 2013-11-22 13:01

View differences:

typo3_src/t3lib/class.t3lib_div.php (revision )
1513 1513
	 * @return boolean Whether the given URL is valid
1514 1514
	 */
1515 1515
	public static function isValidUrl($url) {
1516
		require_once(PATH_typo3 . 'contrib/idna/idna_convert.class.php');
1517
		$IDN = new idna_convert(array('idn_version' => 2008));
1518

  
1519
		return (filter_var($IDN->encode($url), FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== FALSE);
1516
		$parsedUrl = parse_url($url);
1517
		require_once PATH_typo3 . 'contrib/idna/idna_convert.class.php';
1518
		$IDN = new \idna_convert(array('idn_version' => 2008));
1519
		$parsedUrl['host'] = $IDN->encode($parsedUrl['host']);
1520
		$url = t3lib_utility_Http::buildUrl($parsedUrl);
1521
		return filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== FALSE;
1520 1522
	}
1521 1523

  
1522 1524

  
(5-5/13)