Skip to content

Instantly share code, notes, and snippets.

@dcneiner
Created April 3, 2011 19:13
Show Gist options
  • Save dcneiner/900686 to your computer and use it in GitHub Desktop.
Save dcneiner/900686 to your computer and use it in GitHub Desktop.
Older versions of CI can't handle random query string parameters. This is how you clean it out.
<?php
// Place in index.php, at the top
function clean_hnp() {
$reset_query = false;
$keys = array(
'action', 'hnp_post'
);
foreach ($keys as $key) {
if ( isset($_GET[ $key ]) ) {
$reset_query = true;
unset($_GET[ $key ]);
}
}
if ( $reset_query ) {
$_SERVER['QUERY_STRING'] = http_build_query( $_GET );
}
}
clean_hnp();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment