ja:rule:num:外部入力の整数データを無闇にキャストしない
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| ja:rule:num:外部入力の整数データを無闇にキャストしない [2016/03/19 02:12] – created yohgaki | ja:rule:num:外部入力の整数データを無闇にキャストしない [2016/03/19 02:15] (current) – [適合コード例 (strpsn)] yohgaki | ||
|---|---|---|---|
| Line 75: | Line 75: | ||
| // There should be arbitrary length limit validation | // There should be arbitrary length limit validation | ||
| if (strspn(strlen($_GET[' | if (strspn(strlen($_GET[' | ||
| - | throw new Exception(' | + | throw new Exception(' |
| } | } | ||
| // Validate $_GET[' | // Validate $_GET[' | ||
| - | $start = ($_GET[' | + | $start = ($_GET[' |
| if (strspn($_GET[' | if (strspn($_GET[' | ||
| throw new Exception(' | throw new Exception(' | ||
| Line 84: | Line 84: | ||
| </ | </ | ||
| - | このような単純な文字列チェックには正規表現を避け、文字列関数を使用するべである。 | + | このような単純な文字列チェックには正規表現を避け、文字列関数を使用するべきである。 |
| ===== 例外 ===== | ===== 例外 ===== | ||
ja/rule/num/外部入力の整数データを無闇にキャストしない.1458353568.txt.gz · Last modified: 2016/03/19 02:12 by yohgaki
