echo "<pre>\n".$oSql->getUserInfo()."</pre>";
}
- echo "</pre></p></body></head></html>";
+ echo "</pre></p></body></html>";
exit;
}
header('Content-type: text/html; charset=utf-8');
echo "<html><body><h1>Bad Request</h1>";
echo '<p>Nominatim has encountered an error with your request.</p>';
- echo "<p><b>Details:</b> ".$sError,"</p>";
+ echo "<p><b>Details:</b> ".$sError."</p>";
echo '<p>If you feel this error is incorrect feel file an issue on <a href="https://github.com/twain47/Nominatim/issues">Github</a>. Please include the error message above and the URL you used.</p>';
echo "\n</body></html>\n";
exit;
function getParamBool($sName, $bDefault=false)
{
- if (!isset($_GET[$sName])) return $bDefault;
+ if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault;
return (bool) $_GET[$sName];
}
function getParamInt($sName, $bDefault=false)
{
- if (!isset($_GET[$sName])) return $bDefault;
+ if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault;
- if (!preg_match('/^[+-][0-9]+$/', $_GET[$sName]))
+ if (!preg_match('/^[+-]?[0-9]+$/', $_GET[$sName]))
{
userError("Integer number expected for parameter '$sName'");
}
function getParamFloat($sName, $bDefault=false)
{
- if (!isset($_GET[$sName])) return $bDefault;
+ if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault;
if (!preg_match('/^[+-]?[0-9]*\.?[0-9]+$/', $_GET[$sName]))
{
function getParamString($sName, $bDefault=false)
{
- if (!isset($_GET[$sName])) return $bDefault;
+ if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault;
return $_GET[$sName];
}
function getParamSet($sName, $aValues, $sDefault=false)
{
- if (!isset($_GET[$sName])) return $sDefault;
+ if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $sDefault;
if (!in_array($_GET[$sName], $aValues))
{