25) { return self::ERROR_TOOLONG; } // TODO: Check based on language if (hasSwear($tag)) { return self::ERROR_SWEARS; } return false; } public static function fetchID($tag) { $existingTag = query("SELECT ID FROM tig.Tags WHERE Tag LIKE '" . mysqlescape($tag) . "'"); if ($existingTag) { return $existingTag['ID']; } $newTagID = safe_dbwrite("INSERT INTO tig.Tags SET Tag = '" . mysqlescape($tag) . "'"); return $newTagID; } }