Permalink
Browse files

Dodanie funkcji sprawdzającej poprawność URL oraz poprawa funkcji prz…

…ekierowującej
  • Loading branch information...
Andrzejster
Andrzejster committed Aug 18, 2014
1 parent 5ff4d44 commit cb9061fc57fd49c8f290f7608febfc9dfa493edd
Showing with 17 additions and 2 deletions.
  1. +17 −2 system/helpers/main.php
@@ -527,6 +527,20 @@ public static function parseAllTags($text)
{
return self::$_sbb->parseAllTags($text);
}
//==================================
//PL: Sprawdzanie poprawności adresu URL
//==================================
public static function checkURL($url, $replace = array('http://', 'https://', 'www.', '/'))
{
$host = str_replace($replace, NULL, $url);
if (checkdnsrr($host) == TRUE)
{
return true;
}
return false;
}
/** koniec METODY NAPISANE PRZEZ EF TEAM **/
@@ -696,9 +710,10 @@ public static function GetXmlValue($str,$parse)
//PL: Przekierowania
//EN: Redirects
//==================================
public static function redirect($location)
public static function redirect($location, $time = 0)
{
header('Location: '.$location);
header('Refresh:'.$time.'; URL='.$location);
//header('Location: '.$location);
exit;
}

0 comments on commit cb9061f

Please sign in to comment.