Browse Source

fix Response Api

Sevajol Bastien 11 years ago
parent
commit
7452204ebc
1 changed files with 8 additions and 11 deletions
  1. 8 11
      src/Muzich/CoreBundle/lib/Api/Response.php

+ 8 - 11
src/Muzich/CoreBundle/lib/Api/Response.php View File

@@ -30,23 +30,20 @@ class Response
30 30
       }
31 31
     }
32 32
     
33
-    if ($content)
33
+    if (array_key_exists($searched, $content))
34 34
     {
35
-      if (array_key_exists($searched, $content))
35
+      if ($not_empty)
36 36
       {
37
-        if ($not_empty)
37
+        if ((is_null($content[$searched]) || !count($content[$searched]) || !$content[$searched]) && ($content[$searched] !== 0 && $content[$searched] !== '0'))
38 38
         {
39
-          if ((is_null($content[$searched]) || !count($content[$searched]) || !$content[$searched]) && ($content[$searched] !== 0 && $content[$searched] !== '0'))
39
+          return false;
40
+        }
41
+        if (is_string($content[$searched]))
42
+        {
43
+          if (trim($content[$searched]) == '')
40 44
           {
41 45
             return false;
42 46
           }
43
-          if (is_string($content[$searched]))
44
-          {
45
-            if (trim($content[$searched]) == '')
46
-            {
47
-              return false;
48
-            }
49
-          }
50 47
         }
51 48
       }
52 49