本文整理汇总了PHP中sotf_Utils::clean方法的典型用法代码示例。如果您正苦于以下问题:PHP sotf_Utils::clean方法的具体用法?PHP sotf_Utils::clean怎么用?PHP sotf_Utils::clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sotf_Utils
的用法示例。
在下文中一共展示了sotf_Utils::clean方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isNameInUse
/** static */
function isNameInUse($stationName)
{
global $db;
$res = $db->getOne("SELECT count(*) FROM sotf_stations WHERE name='" . sotf_Utils::clean($stationName) . "'");
if (DB::isError($res)) {
raiseError($res);
}
return $res;
}
示例2: getSQLSafeParameter
function getSQLSafeParameter($name)
{
return sotf_Utils::clean(sotf_Utils::getParameter($name), true);
}
示例3: delUserFromStation
/**
* Removes the user from station.
*
* @param string $username Userid
* @param string $station Station
* @return boolean Returns true if succeeded
* @todo Error handling
* @use $db
*/
function delUserFromStation($username, $station)
{
global $db;
$username = sotf_Utils::clean($username);
$station = sotf_Utils::clean($station);
$db->query("DELETE FROM sotf_user_group WHERE username='{$username}' AND station='{$station}'");
return true;
}
示例4: simpleSearch
function simpleSearch($text, $language, $from, $count)
{
$db = $this->db;
$sql = "SELECT * FROM sotf_programmes WHERE published='t' ";
$sql .= " AND (title ~* '{$text}' OR keywords ~* '{$text}' OR abstract ~* '{$text}' OR author ~* '{$text}' OR spatial_coverage ~* '{$text}') ";
if ($language && $language != 'any_language') {
$language = sotf_Utils::clean($language);
$sql .= " AND language='{$language}' ";
}
$sql .= " ORDER BY production_date DESC ";
$res = $db->limitQuery($sql, $from, $count);
if (DB::isError($res)) {
raiseError($res->getMessage());
}
while (DB_OK === $res->fetchInto($row)) {
debug("row", $row['title']);
$list[] = new sotf_Programme($row['id'], $row);
}
return $list;
}
示例5: login
function login($name, $password)
{
global $user, $userdb, $page;
$pwd = $userdb->getOne("SELECT passwd FROM authenticate WHERE username='" . sotf_Utils::clean($name) . "'");
if (DB::isError($pwd)) {
raiseError("could not compare passwords");
}
if ($pwd != $password) {
error_log("Login failed for {$name} from " . getHostName(), 0);
return $page->getlocalized("invalid_login");
} else {
$user = new sotf_User($name);
$userdb->query("UPDATE user_preferences SET num_logins=num_logins+1, last_visit='" . db_Wrap::getSQLDate() . "' WHERE auth_id='" . $user->id . "' ");
$_SESSION['username'] = $user->name;
}
}