DataObjects/Core_event_audit.php
[Pman.Core] / Pman.SearchTokenizer.js
index 55b5ea7..5a0c3c5 100644 (file)
@@ -14,8 +14,8 @@
  
 Pman.SearchTokenizer = function(s)
 {
-        this.str = s;
-        this.strlen = s.length;
+        this.str = typeof(s) == 'string' ? s : '';
+        this.strlen = typeof(s) == 'string' ? s.length : 0;
         this.i = 0;
         this.tokens = [];
        //print_r(this);
@@ -111,7 +111,7 @@ Pman.SearchTokenizer.prototype =  {
         }
         
         if (!q) {
-            if ((s..toUpperCase() == 'AND') || (s.toUpperCase() == 'OR')) {
+            if ((s.toUpperCase() == 'AND') || (s.toUpperCase() == 'OR')) {
                 this.tokens.push( { type: s.toUpperCase() });
                 return;
             }
@@ -136,8 +136,8 @@ Pman.SearchTokenizer.prototype =  {
      
 };
 
-Pman.SearchTokenizer.parse(v) {
-    var x = new Pman.SearchTokenizer();
+Pman.SearchTokenizer.parse = function(v) {
+    var x = new Pman.SearchTokenizer(v);
     return x.parse();
     
 }
\ No newline at end of file