function html_sanitize($str)
{
    static $san = null;
    if (empty($san)) {
        $san = new HTML_Sanitizer();
    }
    return $san->sanitize($str);
}
Exemplo n.º 2
0
<?php

include 'config.php';
include 'dbConnection.php';
include 'xmlDocument.php';
include 'sanitizer.class.php';
$dbConnect = new dbConnection();
$xmlDoc = new xmlDocument();
$san = new HTML_Sanitizer();
$userId = $dbConnect->checkLogin($_GET['lname'], $_GET['pwstr']);
if (!isset($_GET['pwstr']) || !isset($_GET['lname']) || $userId == false) {
    die("away");
}
function mkdir_recursive($pathname, $mode)
{
    is_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname), $mode);
    return is_dir($pathname) || @mkdir($pathname, $mode);
}
function fixDirName($dir)
{
    if ($dir[strlen($dir) - 1] != '/') {
        $dir = $dir . "/";
    }
    return $dir;
}
//e.g. from = "/files", to = "/files/myFiles/Images", deletes the folders images and myfiles if empty, path is always relative to work dir!
function rmdir_fromTo($from, $to)
{
    $to = trim($to, '/');
    $from = trim($from, '/');
    if (!is_dir($to) || !is_dir($from) || strlen($to) <= strlen($from)) {