// Simple check for spider
function isSpider () {
- // Get the UA
- $userAgent = strtolower(detectUserAgent(true));
+ // Get the UA and trim it down
+ $userAgent = trim(strtolower(detectUserAgent(true)));
// It should not be empty, if so it is better a spider/bot
if (empty($userAgent)) return true;
// Encodes entities
function encodeEntities ($str) {
// Secure it first
- $str = secureString($str);
+ $str = secureString($str, true, true);
// Encode dollar sign as well
$str = str_replace('$', '$', $str);