L
L
LittleFatNinja2015-07-31 14:19:14
PHP
LittleFatNinja, 2015-07-31 14:19:14

How to safely output {$smarty.get.sort} via smarty?

A parameter is passed to GET, let's say sort. How to safely withdraw through smarty {$smarty.get.sort}?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ivanov, 2015-07-31
@LittleFatNinja

If you don't have an explicit type for this variable, it's dangerous. If there is a rigid typing, then there should be no questions about safe.
In the code, check either is_int and others or with a type ghost ( int ) $_GET['sort'];
in smarty this is {if $smarty.get.sort|is_int} TRUE {/if}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question