function sanitize($s, $flags) { if (!safe_get("keephtml", $flags)) { $s = strip_tags($s); } $s = unformat_word2($s, safe_get("lang", $flags)); if (safe_get("stripspaces", $flags)) { $s = preg_replace('/\\s+/ig', "", $s); } else { $s = normalize_spaces($s); } return $s; }
<?php require_once '/var/www/config.php'; sro('/Includes/mysql.php'); sro('/Includes/session.php'); sro('/Includes/functions.php'); sro('/PHP5/lib/PHPLang/db.php'); if (!requireRank(3, FALSE)) { echo "Insufficient permissions"; } else { if (array_key_exists("id", $_GET) and array_key_exists("newpos", $_GET) and is_numeric($_GET["id"])) { $w = WORD(defaultDB(), intval($_GET["id"])); $w->set_speechpart(normalize_spaces($_GET["newpos"])); exit("success"); } else { exit("\$_GET was invalid"); } }
function slugify($w, $lang = NULL) { if (ISWORD($w)) { if ($lang === NULL) { $lang = $w->lang(); } $w = $w->name(); } $w = mb_strtolower(fewer_specials($w), "utf-8"); if ($lang === "la") { $w = str_replace("j", "i", $w); } return normalize_spaces($w); }
<?php require_once '/var/www/config.php'; sro('/Includes/mysql.php'); sro('/Includes/session.php'); sro('/Includes/functions.php'); sro('/PHP5/lib/PHPLang/db.php'); if (!requireRank(3, FALSE)) { echo "Insufficient permissions"; } else { if (array_key_exists("id", $_GET) and array_key_exists("newname", $_GET) and is_numeric($_GET["id"])) { $w = WORD(defaultDB(), intval($_GET["id"])); $w->set_name(normalize_spaces($_GET["newname"])); exit("success"); } else { exit("\$_GET was invalid"); } }