| Server IP : 74.208.250.37 / Your IP : 216.73.216.114 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : miferval ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/aprendizajeodisea/system/ |
Upload File : |
<?php
/**
* @package system
*
*/
/**
* Redirect the browser to specific location
* from symfony
*/
function redirect ($url)
{
// Just make sure.
$url = str_replace('Location:', null, $url);
if (headers_sent($filename, $line)) {
echo "<h1>Error: No se puede redireccionar a <a href=\"$url\">$url</a></h1><p>El Output ya inicio en $filename en la linea $line</p>";
exit;
}
// convert idn back to ascii for redirect
if (function_exists('idn_to_ascii')) {
$root = parse_url(URL);
$host = $root['host'];
$url = str_replace($host, idn_to_ascii($host), $url);
}
header('Status: 302 Found');
header('Expires: Mon, 12 Dec 1982 06:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header("Location: $url");
exit;
}
//Check if constant exist
function define_safe($name, $value)
{
if (!defined($name)) {
define($name, $value);
}
}
function stripAccents($string){
$a = array('á','é','í','ó','ú','Á','É','Í','Ó','Ú','Ñ','ñ');
$b = array('a','e','i','o','u','A','E','I','O','U','N','n');
return str_replace($a, $b, $string);
}
function doUrlName($string){
$url = stripAccents($string);
$url = preg_replace("![^a-z0-9]+!i", "-", $url);
$url = strtolower($url);
echo $url;
}
function doUrlNameCli($string){
$url = stripAccents($string);
$url = preg_replace("![^a-z0-9]+!i", "-", $url);
$url = strtolower($url);
return $url;
}
function truncate($str, $len) {
$tail = max(0, $len-10);
$trunk = substr($str, 0, $tail);
$trunk .= strrev(preg_replace('~^..+?[\s,:]\b|^...~', '...', strrev(substr($str, $tail, $len-$tail))));
return $trunk;
}