Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanitizeInputValues() gives a warning when type is set to 'numeric' and it must return the default #963

Closed
mgc8 opened this issue Sep 2, 2009 · 4 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@mgc8
Copy link

mgc8 commented Sep 2, 2009

The function accepts a $varType of 'numeric' which it interprets as either 'int' or 'float', and when the value does not match any of these, it must return the $varDefault parameter. However, the following line:

settype($varDefault, $varType);

gives a warning sine 'numeric' is not a valid settype parameter.

Keywords: sanitizeInputValues, settype, numeric

@robocoder
Copy link
Contributor

Propose to remove the 'numeric' case, and change all affected getRequestVar() calls to 'int'. (A quick grep shows it only used to get the 'h', 'm', and 's' parameters.)

@robocoder
Copy link
Contributor

Matt: in getRequestVar(), should we remove the 'array' case too? I don't believe it's possible to pass an array as a GET/POST parameter (except as something encoded, e.g., JSON, in which case, it would be a string).

@robocoder
Copy link
Contributor

scratch that last comment I forgot PHP handles returns an array when the URL contains parameters like this: x[]=1&x[]=3&x[]=4

@robocoder
Copy link
Contributor

In [1450], fixes #963 - remove 'numeric' as a getRequestVar() type

@mgc8 mgc8 added this to the Piwik 0.4.4 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants