$url = $ref;
}
}
+ self::logm('redirect to ' . $url);
header('Location: '.$url);
exit();
}
{
if (DEBUG_POCHE) {
$t = strval(date('Y/m/d_H:i:s')) . ' - ' . $_SERVER["REMOTE_ADDR"] . ' - ' . strval($message) . "\n";
- file_put_contents('./log.txt', $t, FILE_APPEND);
+ file_put_contents(CACHE . '/log.txt', $t, FILE_APPEND);
+ error_log('DEBUG POCHE : ' . $message);
}
}
{
return sha1($string . SALT);
}
+
+ public static function checkVar($var, $default = '')
+ {
+ return ((isset ($_REQUEST["$var"])) ? htmlentities($_REQUEST["$var"]) : $default);
+ }
+
+ public static function getDomain($url)
+ {
+ $pieces = parse_url($url);
+ $domain = isset($pieces['host']) ? $pieces['host'] : '';
+ if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) {
+ return $regs['domain'];
+ }
+
+ return FALSE;
+ }
}
\ No newline at end of file