From cedb9cd024afe119b01cb4e5ab0b04b131c7674c Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 22 Aug 2014 12:14:52 -0500
Subject: [PATCH] lint: Fix static analysis errors

---
 include/class.plugin.php   | 2 ++
 include/class.search.php   | 1 +
 setup/test/tests/stubs.php | 9 +++++++++
 3 files changed, 12 insertions(+)

diff --git a/include/class.plugin.php b/include/class.plugin.php
index d553e5e22..a6b653697 100644
--- a/include/class.plugin.php
+++ b/include/class.plugin.php
@@ -68,6 +68,8 @@ class PluginConfig extends Config {
     }
 
     function commitForm(&$errors=array()) {
+        global $msg;
+
         $f = $this->getForm();
         $commit = false;
         if ($f->isValid()) {
diff --git a/include/class.search.php b/include/class.search.php
index 1beeb2d5c..c6449156b 100644
--- a/include/class.search.php
+++ b/include/class.search.php
@@ -296,6 +296,7 @@ class MysqlSearchBackend extends SearchBackend {
             $key = 'COALESCE(B1.ticket_id, B2.ticket_id, B3.ticket_id, B4.ticket_id)';
             $tables[] = "{$P}ticket A1 ON (A1.ticket_id = {$key})";
             $cdata_search = false;
+            $where = array();
 
             if ($criteria) {
                 foreach ($criteria as $name=>$value) {
diff --git a/setup/test/tests/stubs.php b/setup/test/tests/stubs.php
index c13e78121..5e3904e62 100644
--- a/setup/test/tests/stubs.php
+++ b/setup/test/tests/stubs.php
@@ -10,6 +10,7 @@ class mysqli {
     function real_connect() {}
     function select_db() {}
     function set_charset() {}
+    function autocommit() {}
 }
 
 class mysqli_stmt {
@@ -113,4 +114,12 @@ class finfo {
 class Locale {
     function getDisplayName() {}
 }
+class IntlBreakIterator {
+    static function createWordInstance() {}
+    function setText() {}
+}
+
+class SqlFunction {
+    static function NOW() {}
+}
 ?>
-- 
GitLab