Skip to content

Instantly share code, notes, and snippets.

@euank
Created November 11, 2013 14:48
Show Gist options
  • Save euank/7414238 to your computer and use it in GitHub Desktop.
Save euank/7414238 to your computer and use it in GitHub Desktop.
Code found in the wild (all in the same project)
if (stopped) {
// don't proceed
} else {
// proceed
/* code */
}
/* Note, there are a ton of these. if(CONDITION) { /* don't do anything */ } else { /* code */} ... I suspect the programmer did not know you could do if(!CONDITION)
/* Letting the user clobber any global variable by setting a query param... Yup, good idea */
if(is_array($_GET))
{
foreach($_GET as $key=>$value)
{
$$key = $value;
}
}
if(is_array($_POST))
{
foreach($_POST as $key=>$value)
{
$$key = $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment