Created
April 3, 2011 19:13
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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