Skip to content

Commit

Permalink
Strip null bytes out of GPC input strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Oct 12, 2013
1 parent 906cc47 commit fc02c46
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/gpc_api.php
Expand Up @@ -111,7 +111,7 @@ function gpc_get_string( $p_var_name, $p_default = null ) {
trigger_error( ERROR_GPC_ARRAY_UNEXPECTED, ERROR );
}

return $t_result;
return str_replace( "\0","",$t_result );
}

/**
Expand Down Expand Up @@ -256,7 +256,11 @@ function gpc_get_string_array( $p_var_name, $p_default = null ) {
trigger_error( ERROR_GPC_ARRAY_EXPECTED, ERROR );
}

return $t_result;
$t_array = array();
foreach( $t_result as $key => $val ) {
$t_array[$key] = str_replace( "\0", "", $val );
}
return $t_array;
}

/**
Expand Down

0 comments on commit fc02c46

Please sign in to comment.