Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
That's JavaScript, right? That $page variable is a JavaScript variable, and he's filling that policy_err variable from PHP when rendering the output.
Or maybe he has mixed one with the other thinking (like many starters do) that they can run PHP code just like that from client code? -
xewl40527y@linuxxx @PrivateGER
echo 'var say=' . (!empty($_GET['what']) && is_string($_GET['what']) ? '"'.escape_str($_GET['what']).'"' : 'null' ) . ';'; -
xewl40527y@PrivateGER probably.. depends on how/where exactly u'd use it (thinking eg. a dynamically built .js file/endpoint) -
stacked26287yThat code is actually a great cross-site scripting opportunity. Your coworker is a genius if he/she is planning to steal from your company, or trick your users. But most probably is an idiot. Yes, he's an idiot.
Related Rants

What only relying on JavaScript for HTML form input validation looks like
Found something true as 1 == 1
Don't know if the author is a genius or an idiot. Thoughts ?
rant
js
php