6,6 → 6,10 |
// CODIERUNGSFUNKTIONEN // |
////////////////////////////////////////////////////////////////////////////// |
|
function wb_htmlentities($x) { |
return htmlentities($x, ENT_COMPAT, 'iso-8859-1'); |
} |
|
function encode_critical_html_characters($inp) |
{ |
$inp = str_replace('&', '&', $inp); |
29,7 → 33,7 |
function executable_html_code($inp) |
{ |
// Wenn der Benutzer z.B. ä im HTML-Formular eingegeben hat, würde hier aufgrund von Unicode quatsch rauskommen |
$inp = htmlentities($inp, ENT_COMPAT, 'UTF-8'); |
$inp = wb_htmlentities($inp, ENT_COMPAT, 'UTF-8'); |
|
$inp = decode_critical_html_characters($inp); |
|
307,7 → 311,7 |
return $return; |
} |
|
function my_htmlentities($inp, $charset = 'utf-8') |
function my_wb_htmlentities($inp, $charset = 'utf-8') |
{ |
// http://www.php.net/manual/de/function.htmlspecialchars.php |
// PHP-Version wird nicht kontrolliert... |
342,12 → 346,12 |
if (strtolower($charset) == 'euc-jp') $cs = 'EUC-JP'; |
if (strtolower($charset) == 'eucjp') $cs = 'EUC-JP'; |
|
return @htmlentities($inp, ENT_NOQUOTES, $cs); |
return @wb_htmlentities($inp, ENT_NOQUOTES, $cs); |
} |
|
function check_email($email_adresse) |
{ |
if(eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$",$email_adresse)) |
if(preg_match("|^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$|ismU",$email_adresse)) |
return true; |
else |
return false; |
531,7 → 535,7 |
else |
$g = 'designs/spacer.gif'; |
|
return "javascript:oop('".$modul."', '".$seite."', '".htmlentities($module_information->caption)."', '".$g."');"; |
return "javascript:oop('".$modul."', '".$seite."', '".wb_htmlentities($module_information->caption)."', '".$g."');"; |
} |
|
function wb_list_items($modul, $table, $append, $dir = 0) |
680,10 → 684,208 |
// FUNKTIONEN FÜR MODUL-XML UND DESIGN-XML // |
////////////////////////////////////////////////////////////////////////////// |
|
require 'includes/WBModulHandler.class.php'; |
class WebBase_Module_Info |
{ |
private $f_name; |
private $f_author; |
private $f_version; |
private $f_language; |
|
require 'includes/WBDesignHandler.class.php'; |
// 0 = Public Freeware |
// 1 = Public Shareware |
// 2 = Private Secured |
// 3 = Personal WebBase-Core |
// 4 = Personal WebBase-Enclosure |
private $f_license; |
|
function name() { |
return $this->f_name; |
} |
|
function author() { |
return $this->f_author; |
} |
|
function version() { |
return $this->f_version; |
} |
|
function language() { |
return $this->f_language; |
} |
|
function license() { |
return $this->f_license; |
} |
|
function WebBase_Module_Info($name, $author, $version, $language, $license) { |
$this->f_name = $name; |
$this->f_author = $author; |
$this->f_version = $version; |
$this->f_language = $language; |
$this->f_license = $license; |
} |
}; |
|
class WBModuleHandler { |
|
private static $cache_module_information = Array(); |
|
function get_module_information($modulename) |
{ |
if (isset(self::$cache_module_information[$modulename])) { |
return self::$cache_module_information[$modulename]; |
} |
|
if (function_exists('getmicrotime')) $ss = getmicrotime(); |
|
$xml = new xml(); |
|
if ((!strpos($modulename, '..')) && (file_exists('modules/'.$modulename.'/info.xml'))) |
{ |
$object = $xml->xml_file_to_object('modules/'.$modulename.'/info.xml'); |
|
if ($object->name == 'moduleinfo') |
{ |
$v_expected_name = ''; |
$v_author = ''; |
$v_version = ''; |
$v_language = ''; |
$v_license = ''; |
|
foreach ($object->children as $m1 => $m2) |
{ |
if ($object->children[$m1]->name == 'expected_name') $v_expected_name = $object->children[$m1]->content; |
if ($object->children[$m1]->name == 'author') $v_author = $object->children[$m1]->content; |
if ($object->children[$m1]->name == 'version') $v_version = $object->children[$m1]->content; |
if ($object->children[$m1]->name == 'language') $v_language = $object->children[$m1]->content; |
if ($object->children[$m1]->name == 'license') $v_license = $object->children[$m1]->content; |
} |
|
$output = new WebBase_Module_Info($v_expected_name, $v_author, $v_version, $v_language, $v_license); |
|
if ($output->caption == '') $output->caption = $modulename; |
|
if (function_exists('getmicrotime')) { |
$ee = getmicrotime(); |
global $xml_time; |
$xml_time += $ee-$ss; |
global $xml_count; |
$xml_count++; |
} |
|
self::$cache_module_information[$modulename] = $output; |
|
return $output; |
} |
else |
{ |
return NULL; |
} |
} |
else |
{ |
return NULL; |
} |
} |
|
} |
|
class WebBase_Design_Info |
{ |
private $f_name; |
private $f_author; |
private $f_version; |
|
// 0 = Third-Party-Product |
// 1 = Official Product |
private $f_license; |
|
function name() { |
return $this->f_name; |
} |
|
function author() { |
return $this->f_author; |
} |
|
function version() { |
return $this->f_version; |
} |
|
function license() { |
return $this->f_license; |
} |
|
function WebBase_Design_Info($name, $author, $version, $license) { |
$this->f_name = $name; |
$this->f_author = $author; |
$this->f_version = $version; |
$this->f_license = $license; |
} |
}; |
|
class WBModuleHandler { |
|
private static $cache_design_information = Array(); |
|
function get_design_information($designname) |
{ |
if (isset(self::$cache_design_information[$designname])) { |
return self::$cache_design_information[$designname]; |
} |
|
if (function_exists('getmicrotime')) $ss = getmicrotime(); |
|
$xml = new xml(); |
|
if ((!strpos($designname, '..')) && (file_exists('designs/'.$designname.'/info.xml'))) |
{ |
$object = $xml->xml_file_to_object('designs/'.$designname.'/info.xml'); |
|
if ($object->name == 'designinfo') |
{ |
$v_name = ''; |
$v_author = ''; |
$v_version = ''; |
$v_license = ''; |
|
foreach ($object->children as $m1 => $m2) |
{ |
if ($object->children[$m1]->name == 'name') $v_name = $object->children[$m1]->content; |
if ($object->children[$m1]->name == 'author') $v_author = $object->children[$m1]->content; |
if ($object->children[$m1]->name == 'version') $v_version = $object->children[$m1]->content; |
if ($object->children[$m1]->name == 'license') $v_license = $object->children[$m1]->content; |
} |
|
$output = new WebBase_Design_Info($v_name, $v_author, $v_version, $v_license); |
|
if ($output->name == '') $output->name = $designname; |
|
if (function_exists('getmicrotime')) { |
$ee = getmicrotime(); |
global $xml_time; |
$xml_time += $ee-$ss; |
global $xml_count; |
$xml_count++; |
} |
|
self::$cache_design_information[$designname] = $output; |
|
return $output; |
} |
else |
{ |
return NULL; |
} |
} |
else |
{ |
return NULL; |
} |
} |
} |
|
/* Konstanten */ |
|
define('RELATIVE_DIR', dir_add_trailing_backslash(dirname($_SERVER['PHP_SELF']))); |