
if (file_exists(UN_FULLAPP_PATH."includes/un_magicseourl.php")) {
include_once(UN_FULLAPP_PATH."includes/un_magicseourl.php");
}

if (file_exists(UN_FULLAPP_PATH."includes/subor.php")) {
include_once(UN_FULLAPP_PATH."includes/subor.php");
}



ob_start( "wtric" );
/*$output = ob_get_contents();
$output = trim($output);
ob_end_clean();*/


/*@ini_set('error_reporting',E_ALL);
@ini_set("display_errors","on");
error_reporting(E_ALL);
*/


function wtric($output) {
$output = trim($output);


//"<?xml version=\"1.0\" encoding=\""._CHARSET."\"?>";


if ((strpos($output, "<!DOCTYPE") > strpos($output, "<html")) or (strpos($output, "<!DOCTYPE") === false)) {
$output = str_replace('<html', "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html", $output);
}


$html_nazov = "<html "._HTML_PARAMS.">";
if (strpos($output, $html_nazov)) {
$output = preg_replace('/<html dir="([a-z]*)" lang="([a-z]*)">/im', '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$2" lang="$2">', $output);
}
$meta_Content_text_html = '<meta http-equiv="Content-Type" content="text/html; charset';
$meta_Content_xhtml = '<meta http-equiv="Content-Type" content="application/xhtml+xml; charset';
$output = str_replace($meta_Content_text_html, $meta_Content_xhtml, $output);




$output = encode_chars($output);
$output = preg_replace("/<img([^>]*)alt=([^>]*)>/im", "<img$1 alt=$2>", $output);
$output = preg_replace("/<img([^`|>]*)>/im", "<img alt=\" \"$1>", $output);
$output = preg_replace("/<img([^>]*)`alt=([^>]*)>/im", "<img$1 alt=$2>", $output);


if (strpos($output, "//W3C//DTD XHTML") !== false) {
$output = preg_replace("/<(img|hr|meta|link|br|base|frame|input|area|col|embed|param|wbr)([^>]*)>/mi", "<$1$2 />", $output);
//$output = preg_replace("/<(img|hr|meta|link|br|base|frame|input)([^>]*)>/mi", "<$1$2 />", $output);
$output = preg_replace("/<(\/?)([a-z]+)( |>)/mie", "'<$1' . strtolower('$2') . '$3'", $output);
$output = preg_replace("/<([^>]+)>/mie", "'<'.process_attributes(stripslashes('$1')).'>'", $output);
$output = preg_replace("/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8})
/i", "&", $output);
}


$output = str_replace("<b>", "<strong>", $output);
$output = str_replace("<i>", "<em>", $output);
$output = str_replace("</b>", "</strong>", $output);
$output = str_replace("</i>", "</em>", $output);


return $output;
} 
function process_attributes($text) {
return preg_replace("/ ([a-z]+)=\"([^( |\")]*)\"/mie", "' ' . strtolower('$1') . '=\"' . stripslashes('$2') . '\"'", $text);
}


function encode_chars($text) {
$text = str_replace("<", "<", $text);
$tag_list = '((\/?)(!DOCTYPE|!--|a(bbr|cronym|ddress|pplet|rea)?|b(ase(font)?|do|ig|lockquote|ody|r|utton)?|c(aption|enter|ite|(o(de|l(group)?)))|d(d|el|fn|i(r|v)|l|t)|em|f(ieldset|o(nt|rm)|rame(set)?)|h(1|2|3|4|5|6|ead|r|tml)|i(frame|mg|n(put|s)|sindex)?|kbd|l(abel|egend|i(nk)?)|m(ap|e(nu|ta))|no(frames|script)|o(bject|l|pt(group|ion))|p(aram|re)?|q|s(amp|cript|elect|mall|pan|t(r(ike|ong)|yle)|u(b|p))|t(able|body|d|extarea|foot|h|itle|r|t)|u(l)?|var)([^>]*))';
$text = preg_replace("/(<)" . $tag_list . "(>)/mi", "<$2>", $text);
$text = preg_replace("/(>[^<]*)>/mi", "$1>", $text);
$text = str_replace(" />", ">", $text);
$text = str_replace("/>", ">", $text);


return $text;
}

Obsah fóra BLASSENweb » Tipy a Triky
![]() |
|