8000 Merge branch '2.0' · skigun/symfony-docs@f3474e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3474e1

Browse files
committed
Merge branch '2.0'
2 parents 0683a4b + 0dc3bd5 commit f3474e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/from_flat_php_to_symfony2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ an individual blog result based on a given id::
263263
{
264264
$link = open_database_connection();
265265

266-
$id = mysql_real_escape_string($id);
266+
$id = intval($id);
267267
$query = 'SELECT date, title, body FROM post WHERE id = '.$id;
268268
$result = mysql_query($query);
269269
$row = mysql_fetch_assoc($result);
@@ -308,7 +308,7 @@ this page introduces even more lingering problems that a framework can solve
308308
for you. For example, a missing or invalid ``id`` query parameter will cause
309309
the page to crash. It would be better if this caused a 404 page to be rendered,
310310
but this can't really be done easily yet. Worse, had you forgotten to clean
311-
the ``id`` parameter via the ``mysql_real_escape_string()`` function, your
311+
the ``id`` parameter via the ``intval()`` function, your
312312
entire database would be at risk for an SQL injection attack.
313313

314314
Another major problem is that each individual controller file must include

0 commit comments

Comments
 (0)
0