Пример #1
0
/**
 * Validates a name for angeltypes.
 * Returns array containing validation success and validated name.
 *
 * @param string $name          
 * @param AngelType $angeltype          
 */
function AngelType_validate_name($name, $angeltype)
{
    $name = strip_item($name);
    if ($name == "") {
        return array(false, $name);
    }
    if (isset($angeltype) && isset($angeltype['id'])) {
        return array(sql_num_query("\n        SELECT * \n        FROM `AngelTypes` \n        WHERE `name`='" . sql_escape($name) . "' \n        AND NOT `id`='" . sql_escape($angeltype['id']) . "'\n        LIMIT 1") == 0, $name);
    } else {
        return array(sql_num_query("\n        SELECT `id` \n        FROM `AngelTypes` \n        WHERE `name`='" . sql_escape($name) . "' \n        LIMIT 1") == 0, $name);
    }
}
Пример #2
0
/**
 * Gibt den gefilterten REQUEST Wert ohne Zeilenumbrüche zurück
 */
function strip_request_item($name)
{
    return strip_item($_REQUEST[$name]);
}