What does this line of code in PHP mean? Specifically the h(u(. What does the "h" and "u" mean?
$passedContactType = h(u($_GET['contact']));
Because I am getting the error:
Notice: Undefined index: contact in FileLocation on line 12
What does this line of code in PHP mean? Specifically the h(u(. What does the "h" and "u" mean?
$passedContactType = h(u($_GET['contact']));
Because I am getting the error:
Notice: Undefined index: contact in FileLocation on line 12
h and u are not standard PHP functions. They are most likely custom functions declared somewhere else in the application.
As for your error, they are most likely not caused by those but rather by the fact that you may not have a 'contact' parameter in your url. A quick fix could be either to check if it's set before executing this statement or to use a default value, but a better approach would be to understand what it's supposed to do.
For that you can dig into the remaining of the code and try to find the declaration of those functions (h and u) and try to understand it. After that, you may use the following to check if the parameter exists :
if (isset($_GET['contact'])) {
//... statement here
}
But I highly suggest you to find what it's supposed to do first and then decide how to fix it.
Edit: Found the definition of an h() function in cakephp : https://api.cakephp.org/2.7/function-h.html If you are using cakephp, what h() does is basically a shorthand of htmlspecialchars(), which escapes special html characters to prevent hacking and deformed expressions.
But I did not find anything for u(). This one may well be a custom function.