diff --git a/include/filter.php b/include/filter.php index f5b558f..422a9cf 100644 --- a/include/filter.php +++ b/include/filter.php @@ -32,10 +32,13 @@ function filter_gpc() switch($aKeys[$i][1]) { case "h": // HTML string - $aClean[$aKeys[$i]] = htmlspecialchars($_REQUEST[$aKeys[$i]]); + $aClean[$aKeys[$i]] = trim(htmlspecialchars($_REQUEST[$aKeys[$i]])); + // if there is no content and no image, make the variable empty + if(strip_tags($aClean[$aKeys[$i]],'')=="") + $aClean[$aKeys[$i]] = ""; break; default: // normal string (no HTML) - $aClean[$aKeys[$i]] = strip_tags($_REQUEST[$aKeys[$i]]); + $aClean[$aKeys[$i]] = trim(strip_tags($_REQUEST[$aKeys[$i]])); break; } break;