Редакция 309 | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
309 | alex-w | 1 | <?php |
2 | /** |
||
3 | * |
||
4 | * Codename: ant-ng - generator of sources.list for Debian and |
||
5 | * distributives, based on Debian |
||
6 | * http://alex-w.org.ru/p/antng/ |
||
7 | * |
||
8 | * Copyright (c) 2009 Alexander Wolf |
||
9 | * Dual licensed under the MIT and GNU LGPL licenses. |
||
10 | * http://alex-w.org.ru/p/antng/license |
||
11 | * |
||
12 | */ |
||
13 | |||
314 | alex-w | 14 | class Security extends Core { |
15 | function __construct() { |
||
309 | alex-w | 16 | } |
17 | |||
18 | function checkInt($value) { |
||
19 | return abs(intval($value)); |
||
20 | } |
||
21 | |||
22 | function checkStr($value, $mode = 0) { |
||
23 | // mode - 0 -> wrap; mode - 1 -> strip; |
||
24 | if ($mode == 0) { |
||
25 | $result = mysql_real_escape_string($value); |
||
26 | } else { |
||
27 | $result = stripslashes($value); |
||
28 | } |
||
29 | return $result; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | ?> |