GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 3d3ece...f480fa )
by gyeong-won
09:44
created
classes/security/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@
 block discarded – undo
11 11
 
12 12
 class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme {
13 13
 
14
-    public $browsable = false;
15
-    public $may_omit_host = true;
14
+	public $browsable = false;
15
+	public $may_omit_host = true;
16 16
 
17
-    public function doValidate(&$uri, $config, $context) {
18
-        $uri->userinfo = null;
19
-        $uri->host     = null;
20
-        $uri->port     = null;
21
-        // we need to validate path against RFC 2368's addr-spec
22
-        return true;
23
-    }
17
+	public function doValidate(&$uri, $config, $context) {
18
+		$uri->userinfo = null;
19
+		$uri->host     = null;
20
+		$uri->port     = null;
21
+		// we need to validate path against RFC 2368's addr-spec
22
+		return true;
23
+	}
24 24
 
25 25
 }
26 26
 
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/URIScheme/news.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@
 block discarded – undo
5 5
  */
6 6
 class HTMLPurifier_URIScheme_news extends HTMLPurifier_URIScheme {
7 7
 
8
-    public $browsable = false;
9
-    public $may_omit_host = true;
8
+	public $browsable = false;
9
+	public $may_omit_host = true;
10 10
 
11
-    public function doValidate(&$uri, $config, $context) {
12
-        $uri->userinfo = null;
13
-        $uri->host     = null;
14
-        $uri->port     = null;
15
-        $uri->query    = null;
16
-        // typecode check needed on path
17
-        return true;
18
-    }
11
+	public function doValidate(&$uri, $config, $context) {
12
+		$uri->userinfo = null;
13
+		$uri->host     = null;
14
+		$uri->port     = null;
15
+		$uri->query    = null;
16
+		// typecode check needed on path
17
+		return true;
18
+	}
19 19
 
20 20
 }
21 21
 
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@
 block discarded – undo
5 5
  */
6 6
 class HTMLPurifier_URIScheme_nntp extends HTMLPurifier_URIScheme {
7 7
 
8
-    public $default_port = 119;
9
-    public $browsable = false;
8
+	public $default_port = 119;
9
+	public $browsable = false;
10 10
 
11
-    public function doValidate(&$uri, $config, $context) {
12
-        $uri->userinfo = null;
13
-        $uri->query    = null;
14
-        return true;
15
-    }
11
+	public function doValidate(&$uri, $config, $context) {
12
+		$uri->userinfo = null;
13
+		$uri->query    = null;
14
+		return true;
15
+	}
16 16
 
17 17
 }
18 18
 
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php 3 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -6,62 +6,62 @@
 block discarded – undo
6 6
 class HTMLPurifier_URISchemeRegistry
7 7
 {
8 8
 
9
-    /**
10
-     * Retrieve sole instance of the registry.
11
-     * @param $prototype Optional prototype to overload sole instance with,
12
-     *                   or bool true to reset to default registry.
13
-     * @note Pass a registry object $prototype with a compatible interface and
14
-     *       the function will copy it and return it all further times.
15
-     */
16
-    public static function instance($prototype = null) {
17
-        static $instance = null;
18
-        if ($prototype !== null) {
19
-            $instance = $prototype;
20
-        } elseif ($instance === null || $prototype == true) {
21
-            $instance = new HTMLPurifier_URISchemeRegistry();
22
-        }
23
-        return $instance;
24
-    }
9
+	/**
10
+	 * Retrieve sole instance of the registry.
11
+	 * @param $prototype Optional prototype to overload sole instance with,
12
+	 *                   or bool true to reset to default registry.
13
+	 * @note Pass a registry object $prototype with a compatible interface and
14
+	 *       the function will copy it and return it all further times.
15
+	 */
16
+	public static function instance($prototype = null) {
17
+		static $instance = null;
18
+		if ($prototype !== null) {
19
+			$instance = $prototype;
20
+		} elseif ($instance === null || $prototype == true) {
21
+			$instance = new HTMLPurifier_URISchemeRegistry();
22
+		}
23
+		return $instance;
24
+	}
25 25
 
26
-    /**
27
-     * Cache of retrieved schemes.
28
-     */
29
-    protected $schemes = array();
26
+	/**
27
+	 * Cache of retrieved schemes.
28
+	 */
29
+	protected $schemes = array();
30 30
 
31
-    /**
32
-     * Retrieves a scheme validator object
33
-     * @param $scheme String scheme name like http or mailto
34
-     * @param $config HTMLPurifier_Config object
35
-     * @param $config HTMLPurifier_Context object
36
-     */
37
-    public function getScheme($scheme, $config, $context) {
38
-        if (!$config) $config = HTMLPurifier_Config::createDefault();
31
+	/**
32
+	 * Retrieves a scheme validator object
33
+	 * @param $scheme String scheme name like http or mailto
34
+	 * @param $config HTMLPurifier_Config object
35
+	 * @param $config HTMLPurifier_Context object
36
+	 */
37
+	public function getScheme($scheme, $config, $context) {
38
+		if (!$config) $config = HTMLPurifier_Config::createDefault();
39 39
 
40
-        // important, otherwise attacker could include arbitrary file
41
-        $allowed_schemes = $config->get('URI.AllowedSchemes');
42
-        if (!$config->get('URI.OverrideAllowedSchemes') &&
43
-            !isset($allowed_schemes[$scheme])
44
-        ) {
45
-            return;
46
-        }
40
+		// important, otherwise attacker could include arbitrary file
41
+		$allowed_schemes = $config->get('URI.AllowedSchemes');
42
+		if (!$config->get('URI.OverrideAllowedSchemes') &&
43
+			!isset($allowed_schemes[$scheme])
44
+		) {
45
+			return;
46
+		}
47 47
 
48
-        if (isset($this->schemes[$scheme])) return $this->schemes[$scheme];
49
-        if (!isset($allowed_schemes[$scheme])) return;
48
+		if (isset($this->schemes[$scheme])) return $this->schemes[$scheme];
49
+		if (!isset($allowed_schemes[$scheme])) return;
50 50
 
51
-        $class = 'HTMLPurifier_URIScheme_' . $scheme;
52
-        if (!class_exists($class)) return;
53
-        $this->schemes[$scheme] = new $class();
54
-        return $this->schemes[$scheme];
55
-    }
51
+		$class = 'HTMLPurifier_URIScheme_' . $scheme;
52
+		if (!class_exists($class)) return;
53
+		$this->schemes[$scheme] = new $class();
54
+		return $this->schemes[$scheme];
55
+	}
56 56
 
57
-    /**
58
-     * Registers a custom scheme to the cache, bypassing reflection.
59
-     * @param $scheme Scheme name
60
-     * @param $scheme_obj HTMLPurifier_URIScheme object
61
-     */
62
-    public function register($scheme, $scheme_obj) {
63
-        $this->schemes[$scheme] = $scheme_obj;
64
-    }
57
+	/**
58
+	 * Registers a custom scheme to the cache, bypassing reflection.
59
+	 * @param $scheme Scheme name
60
+	 * @param $scheme_obj HTMLPurifier_URIScheme object
61
+	 */
62
+	public function register($scheme, $scheme_obj) {
63
+		$this->schemes[$scheme] = $scheme_obj;
64
+	}
65 65
 
66 66
 }
67 67
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@  discard block
 block discarded – undo
35 35
      * @param $config HTMLPurifier_Context object
36 36
      */
37 37
     public function getScheme($scheme, $config, $context) {
38
-        if (!$config) $config = HTMLPurifier_Config::createDefault();
38
+        if (!$config) {
39
+        	$config = HTMLPurifier_Config::createDefault();
40
+        }
39 41
 
40 42
         // important, otherwise attacker could include arbitrary file
41 43
         $allowed_schemes = $config->get('URI.AllowedSchemes');
@@ -45,11 +47,17 @@  discard block
 block discarded – undo
45 47
             return;
46 48
         }
47 49
 
48
-        if (isset($this->schemes[$scheme])) return $this->schemes[$scheme];
49
-        if (!isset($allowed_schemes[$scheme])) return;
50
+        if (isset($this->schemes[$scheme])) {
51
+        	return $this->schemes[$scheme];
52
+        }
53
+        if (!isset($allowed_schemes[$scheme])) {
54
+        	return;
55
+        }
50 56
 
51 57
         $class = 'HTMLPurifier_URIScheme_' . $scheme;
52
-        if (!class_exists($class)) return;
58
+        if (!class_exists($class)) {
59
+        	return;
60
+        }
53 61
         $this->schemes[$scheme] = new $class();
54 62
         return $this->schemes[$scheme];
55 63
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         if (isset($this->schemes[$scheme])) return $this->schemes[$scheme];
49 49
         if (!isset($allowed_schemes[$scheme])) return;
50 50
 
51
-        $class = 'HTMLPurifier_URIScheme_' . $scheme;
51
+        $class = 'HTMLPurifier_URIScheme_'.$scheme;
52 52
         if (!class_exists($class)) return;
53 53
         $this->schemes[$scheme] = new $class();
54 54
         return $this->schemes[$scheme];
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php 3 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -8,95 +8,95 @@
 block discarded – undo
8 8
 class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser
9 9
 {
10 10
 
11
-    protected function parseImplementation($var, $type, $allow_null) {
12
-        if ($allow_null && $var === null) return null;
13
-        switch ($type) {
14
-            // Note: if code "breaks" from the switch, it triggers a generic
15
-            // exception to be thrown. Specific errors can be specifically
16
-            // done here.
17
-            case self::MIXED :
18
-            case self::ISTRING :
19
-            case self::STRING :
20
-            case self::TEXT :
21
-            case self::ITEXT :
22
-                return $var;
23
-            case self::INT :
24
-                if (is_string($var) && ctype_digit($var)) $var = (int) $var;
25
-                return $var;
26
-            case self::FLOAT :
27
-                if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var;
28
-                return $var;
29
-            case self::BOOL :
30
-                if (is_int($var) && ($var === 0 || $var === 1)) {
31
-                    $var = (bool) $var;
32
-                } elseif (is_string($var)) {
33
-                    if ($var == 'on' || $var == 'true' || $var == '1') {
34
-                        $var = true;
35
-                    } elseif ($var == 'off' || $var == 'false' || $var == '0') {
36
-                        $var = false;
37
-                    } else {
38
-                        throw new HTMLPurifier_VarParserException("Unrecognized value '$var' for $type");
39
-                    }
40
-                }
41
-                return $var;
42
-            case self::ALIST :
43
-            case self::HASH :
44
-            case self::LOOKUP :
45
-                if (is_string($var)) {
46
-                    // special case: technically, this is an array with
47
-                    // a single empty string item, but having an empty
48
-                    // array is more intuitive
49
-                    if ($var == '') return array();
50
-                    if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51
-                        // simplistic string to array method that only works
52
-                        // for simple lists of tag names or alphanumeric characters
53
-                        $var = explode(',',$var);
54
-                    } else {
55
-                        $var = preg_split('/(,|[\n\r]+)/', $var);
56
-                    }
57
-                    // remove spaces
58
-                    foreach ($var as $i => $j) $var[$i] = trim($j);
59
-                    if ($type === self::HASH) {
60
-                        // key:value,key2:value2
61
-                        $nvar = array();
62
-                        foreach ($var as $keypair) {
63
-                            $c = explode(':', $keypair, 2);
64
-                            if (!isset($c[1])) continue;
65
-                            $nvar[trim($c[0])] = trim($c[1]);
66
-                        }
67
-                        $var = $nvar;
68
-                    }
69
-                }
70
-                if (!is_array($var)) break;
71
-                $keys = array_keys($var);
72
-                if ($keys === array_keys($keys)) {
73
-                    if ($type == self::ALIST) return $var;
74
-                    elseif ($type == self::LOOKUP) {
75
-                        $new = array();
76
-                        foreach ($var as $key) {
77
-                            $new[$key] = true;
78
-                        }
79
-                        return $new;
80
-                    } else break;
81
-                }
82
-                if ($type === self::ALIST) {
83
-                    trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING);
84
-                    return array_values($var);
85
-                }
86
-                if ($type === self::LOOKUP) {
87
-                    foreach ($var as $key => $value) {
88
-                        if ($value !== true) {
89
-                            trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING);
90
-                        }
91
-                        $var[$key] = true;
92
-                    }
93
-                }
94
-                return $var;
95
-            default:
96
-                $this->errorInconsistent(__CLASS__, $type);
97
-        }
98
-        $this->errorGeneric($var, $type);
99
-    }
11
+	protected function parseImplementation($var, $type, $allow_null) {
12
+		if ($allow_null && $var === null) return null;
13
+		switch ($type) {
14
+			// Note: if code "breaks" from the switch, it triggers a generic
15
+			// exception to be thrown. Specific errors can be specifically
16
+			// done here.
17
+			case self::MIXED :
18
+			case self::ISTRING :
19
+			case self::STRING :
20
+			case self::TEXT :
21
+			case self::ITEXT :
22
+				return $var;
23
+			case self::INT :
24
+				if (is_string($var) && ctype_digit($var)) $var = (int) $var;
25
+				return $var;
26
+			case self::FLOAT :
27
+				if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var;
28
+				return $var;
29
+			case self::BOOL :
30
+				if (is_int($var) && ($var === 0 || $var === 1)) {
31
+					$var = (bool) $var;
32
+				} elseif (is_string($var)) {
33
+					if ($var == 'on' || $var == 'true' || $var == '1') {
34
+						$var = true;
35
+					} elseif ($var == 'off' || $var == 'false' || $var == '0') {
36
+						$var = false;
37
+					} else {
38
+						throw new HTMLPurifier_VarParserException("Unrecognized value '$var' for $type");
39
+					}
40
+				}
41
+				return $var;
42
+			case self::ALIST :
43
+			case self::HASH :
44
+			case self::LOOKUP :
45
+				if (is_string($var)) {
46
+					// special case: technically, this is an array with
47
+					// a single empty string item, but having an empty
48
+					// array is more intuitive
49
+					if ($var == '') return array();
50
+					if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51
+						// simplistic string to array method that only works
52
+						// for simple lists of tag names or alphanumeric characters
53
+						$var = explode(',',$var);
54
+					} else {
55
+						$var = preg_split('/(,|[\n\r]+)/', $var);
56
+					}
57
+					// remove spaces
58
+					foreach ($var as $i => $j) $var[$i] = trim($j);
59
+					if ($type === self::HASH) {
60
+						// key:value,key2:value2
61
+						$nvar = array();
62
+						foreach ($var as $keypair) {
63
+							$c = explode(':', $keypair, 2);
64
+							if (!isset($c[1])) continue;
65
+							$nvar[trim($c[0])] = trim($c[1]);
66
+						}
67
+						$var = $nvar;
68
+					}
69
+				}
70
+				if (!is_array($var)) break;
71
+				$keys = array_keys($var);
72
+				if ($keys === array_keys($keys)) {
73
+					if ($type == self::ALIST) return $var;
74
+					elseif ($type == self::LOOKUP) {
75
+						$new = array();
76
+						foreach ($var as $key) {
77
+							$new[$key] = true;
78
+						}
79
+						return $new;
80
+					} else break;
81
+				}
82
+				if ($type === self::ALIST) {
83
+					trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING);
84
+					return array_values($var);
85
+				}
86
+				if ($type === self::LOOKUP) {
87
+					foreach ($var as $key => $value) {
88
+						if ($value !== true) {
89
+							trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING);
90
+						}
91
+						$var[$key] = true;
92
+					}
93
+				}
94
+				return $var;
95
+			default:
96
+				$this->errorInconsistent(__CLASS__, $type);
97
+		}
98
+		$this->errorGeneric($var, $type);
99
+	}
100 100
 
101 101
 }
102 102
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                     if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51 51
                         // simplistic string to array method that only works
52 52
                         // for simple lists of tag names or alphanumeric characters
53
-                        $var = explode(',',$var);
53
+                        $var = explode(',', $var);
54 54
                     } else {
55 55
                         $var = preg_split('/(,|[\n\r]+)/', $var);
56 56
                     }
Please login to merge, or discard this patch.
Braces   +27 added lines, -10 removed lines patch added patch discarded remove patch
@@ -9,7 +9,9 @@  discard block
 block discarded – undo
9 9
 {
10 10
 
11 11
     protected function parseImplementation($var, $type, $allow_null) {
12
-        if ($allow_null && $var === null) return null;
12
+        if ($allow_null && $var === null) {
13
+        	return null;
14
+        }
13 15
         switch ($type) {
14 16
             // Note: if code "breaks" from the switch, it triggers a generic
15 17
             // exception to be thrown. Specific errors can be specifically
@@ -21,10 +23,14 @@  discard block
 block discarded – undo
21 23
             case self::ITEXT :
22 24
                 return $var;
23 25
             case self::INT :
24
-                if (is_string($var) && ctype_digit($var)) $var = (int) $var;
26
+                if (is_string($var) && ctype_digit($var)) {
27
+                	$var = (int) $var;
28
+                }
25 29
                 return $var;
26 30
             case self::FLOAT :
27
-                if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var;
31
+                if ((is_string($var) && is_numeric($var)) || is_int($var)) {
32
+                	$var = (float) $var;
33
+                }
28 34
                 return $var;
29 35
             case self::BOOL :
30 36
                 if (is_int($var) && ($var === 0 || $var === 1)) {
@@ -46,7 +52,9 @@  discard block
 block discarded – undo
46 52
                     // special case: technically, this is an array with
47 53
                     // a single empty string item, but having an empty
48 54
                     // array is more intuitive
49
-                    if ($var == '') return array();
55
+                    if ($var == '') {
56
+                    	return array();
57
+                    }
50 58
                     if (strpos($var, "\n") === false && strpos($var, "\r") === false) {
51 59
                         // simplistic string to array method that only works
52 60
                         // for simple lists of tag names or alphanumeric characters
@@ -55,29 +63,38 @@  discard block
 block discarded – undo
55 63
                         $var = preg_split('/(,|[\n\r]+)/', $var);
56 64
                     }
57 65
                     // remove spaces
58
-                    foreach ($var as $i => $j) $var[$i] = trim($j);
66
+                    foreach ($var as $i => $j) {
67
+                    	$var[$i] = trim($j);
68
+                    }
59 69
                     if ($type === self::HASH) {
60 70
                         // key:value,key2:value2
61 71
                         $nvar = array();
62 72
                         foreach ($var as $keypair) {
63 73
                             $c = explode(':', $keypair, 2);
64
-                            if (!isset($c[1])) continue;
74
+                            if (!isset($c[1])) {
75
+                            	continue;
76
+                            }
65 77
                             $nvar[trim($c[0])] = trim($c[1]);
66 78
                         }
67 79
                         $var = $nvar;
68 80
                     }
69 81
                 }
70
-                if (!is_array($var)) break;
82
+                if (!is_array($var)) {
83
+                	break;
84
+                }
71 85
                 $keys = array_keys($var);
72 86
                 if ($keys === array_keys($keys)) {
73
-                    if ($type == self::ALIST) return $var;
74
-                    elseif ($type == self::LOOKUP) {
87
+                    if ($type == self::ALIST) {
88
+                    	return $var;
89
+                    } elseif ($type == self::LOOKUP) {
75 90
                         $new = array();
76 91
                         foreach ($var as $key) {
77 92
                             $new[$key] = true;
78 93
                         }
79 94
                         return $new;
80
-                    } else break;
95
+                    } else {
96
+                    	break;
97
+                    }
81 98
                 }
82 99
                 if ($type === self::ALIST) {
83 100
                     trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING);
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/VarParser/Native.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@
 block discarded – undo
8 8
 class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser
9 9
 {
10 10
 
11
-    protected function parseImplementation($var, $type, $allow_null) {
12
-        return $this->evalExpression($var);
13
-    }
11
+	protected function parseImplementation($var, $type, $allow_null) {
12
+		return $this->evalExpression($var);
13
+	}
14 14
 
15
-    protected function evalExpression($expr) {
16
-        $var = null;
17
-        $result = eval("\$var = $expr;");
18
-        if ($result === false) {
19
-            throw new HTMLPurifier_VarParserException("Fatal error in evaluated code");
20
-        }
21
-        return $var;
22
-    }
15
+	protected function evalExpression($expr) {
16
+		$var = null;
17
+		$result = eval("\$var = $expr;");
18
+		if ($result === false) {
19
+			throw new HTMLPurifier_VarParserException("Fatal error in evaluated code");
20
+		}
21
+		return $var;
22
+	}
23 23
 
24 24
 }
25 25
 
Please login to merge, or discard this patch.
classes/xml/XmlGenerator.class.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@
 block discarded – undo
60 60
 							{
61 61
 								$body .= $this->_makexml($arrNode);
62 62
 							}
63
-						}
64
-						else if(is_object($value))
63
+						} else if(is_object($value))
65 64
 						{
66 65
 							$body = $this->_makexml($value);
67 66
 						}
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$buff = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
21 21
 
22
-		foreach($xml as $nodeName => $nodeItem)
22
+		foreach ($xml as $nodeName => $nodeItem)
23 23
 		{
24 24
 			$buff .= $this->_makexml($nodeItem);
25 25
 		}
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 	function _makexml($node)
35 35
 	{
36 36
 		$body = '';
37
-		foreach($node as $key => $value)
37
+		foreach ($node as $key => $value)
38 38
 		{
39
-			switch($key)
39
+			switch ($key)
40 40
 			{
41 41
 				case 'node_name' : break;
42 42
 				case 'attrs' : {
43 43
 						$attrs = '';
44
-						if(isset($value))
44
+						if (isset($value))
45 45
 						{
46
-							foreach($value as $attrName => $attrValue)
46
+							foreach ($value as $attrName => $attrValue)
47 47
 							{
48 48
 								$attrs .= sprintf(' %s="%s"', $attrName, htmlspecialchars($attrValue, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
49 49
 							}
@@ -54,21 +54,21 @@  discard block
 block discarded – undo
54 54
 					$body = $value;
55 55
 					break;
56 56
 				default : {
57
-						if(is_array($value))
57
+						if (is_array($value))
58 58
 						{
59
-							foreach($value as $idx => $arrNode)
59
+							foreach ($value as $idx => $arrNode)
60 60
 							{
61 61
 								$body .= $this->_makexml($arrNode);
62 62
 							}
63 63
 						}
64
-						else if(is_object($value))
64
+						else if (is_object($value))
65 65
 						{
66 66
 							$body = $this->_makexml($value);
67 67
 						}
68 68
 					}
69 69
 			}
70 70
 		}
71
-		return sprintf('<%s%s>%s</%s>' . "\n", $node->node_name, $attrs, $body, $node->node_name);
71
+		return sprintf('<%s%s>%s</%s>'."\n", $node->node_name, $attrs, $body, $node->node_name);
72 72
 	}
73 73
 
74 74
 }
Please login to merge, or discard this patch.
classes/xml/XmlJsFilter.class.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,8 +102,7 @@
 block discarded – undo
102 102
 		if(!file_exists($this->js_file))
103 103
 		{
104 104
 			$this->_compile();
105
-		}
106
-		else if(filemtime($this->xml_file) > filemtime($this->js_file))
105
+		} else if(filemtime($this->xml_file) > filemtime($this->js_file))
107 106
 		{
108 107
 			$this->_compile();
109 108
 		}
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 	function XmlJsFilter($path, $xml_file)
83 83
 	{
84
-		if(substr($path, -1) !== '/')
84
+		if (substr($path, -1) !== '/')
85 85
 		{
86 86
 			$path .= '/';
87 87
 		}
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	function compile()
97 97
 	{
98
-		if(!file_exists($this->xml_file))
98
+		if (!file_exists($this->xml_file))
99 99
 		{
100 100
 			return;
101 101
 		}
102
-		if(!file_exists($this->js_file))
102
+		if (!file_exists($this->js_file))
103 103
 		{
104 104
 			$this->_compile();
105 105
 		}
106
-		else if(filemtime($this->xml_file) > filemtime($this->js_file))
106
+		else if (filemtime($this->xml_file) > filemtime($this->js_file))
107 107
 		{
108 108
 			$this->_compile();
109 109
 		}
@@ -136,25 +136,25 @@  discard block
 block discarded – undo
136 136
 
137 137
 
138 138
 		$field_node = $xml_obj->filter->form->node;
139
-		if($field_node && !is_array($field_node))
139
+		if ($field_node && !is_array($field_node))
140 140
 		{
141 141
 			$field_node = array($field_node);
142 142
 		}
143 143
 
144 144
 		$parameter_param = $xml_obj->filter->parameter->param;
145
-		if($parameter_param && !is_array($parameter_param))
145
+		if ($parameter_param && !is_array($parameter_param))
146 146
 		{
147 147
 			$parameter_param = array($parameter_param);
148 148
 		}
149 149
 
150 150
 		$response_tag = $xml_obj->filter->response->tag;
151
-		if($response_tag && !is_array($response_tag))
151
+		if ($response_tag && !is_array($response_tag))
152 152
 		{
153 153
 			$response_tag = array($response_tag);
154 154
 		}
155 155
 
156 156
 		// If extend_filter exists, result returned by calling the method
157
-		if($extend_filter)
157
+		if ($extend_filter)
158 158
 		{
159 159
 			// If extend_filter exists, it changes the name of cache not to use cache
160 160
 			$this->js_file .= '.nocache.js';
@@ -163,24 +163,24 @@  discard block
 block discarded – undo
163 163
 			list($module_name, $method) = explode('.', $extend_filter);
164 164
 
165 165
 			// contibue if both module_name and methos exist.
166
-			if($module_name && $method)
166
+			if ($module_name && $method)
167 167
 			{
168 168
 				// get model object of the module
169 169
 				$oExtendFilter = getModel($module_name);
170 170
 
171 171
 				// execute if method exists
172
-				if(method_exists($oExtendFilter, $method))
172
+				if (method_exists($oExtendFilter, $method))
173 173
 				{
174 174
 					// get the result
175 175
 					$extend_filter_list = $oExtendFilter->{$method}(TRUE);
176 176
 					$extend_filter_count = count($extend_filter_list);
177 177
 
178 178
 					// apply lang_value from the result to the variable
179
-					for($i = 0; $i < $extend_filter_count; $i++)
179
+					for ($i = 0; $i < $extend_filter_count; $i++)
180 180
 					{
181 181
 						$name = $extend_filter_list[$i]->name;
182 182
 						$lang_value = $extend_filter_list[$i]->lang;
183
-						if($lang_value)
183
+						if ($lang_value)
184 184
 						{
185 185
 							$lang->{$name} = $lang_value;
186 186
 						}
@@ -200,15 +200,15 @@  discard block
 block discarded – undo
200 200
 		$fields = array();
201 201
 
202 202
 		// create custom rule
203
-		if($rules && $rules->rule)
203
+		if ($rules && $rules->rule)
204 204
 		{
205
-			if(!is_array($rules->rule))
205
+			if (!is_array($rules->rule))
206 206
 			{
207 207
 				$rules->rule = array($rules->rule);
208 208
 			}
209
-			foreach($rules->rule as $r)
209
+			foreach ($rules->rule as $r)
210 210
 			{
211
-				if($r->attrs->type == 'regex')
211
+				if ($r->attrs->type == 'regex')
212 212
 				{
213 213
 					$js_rules[] = "v.cast('ADD_RULE', ['{$r->attrs->name}', {$r->body}]);";
214 214
 				}
@@ -217,14 +217,14 @@  discard block
 block discarded – undo
217 217
 
218 218
 		// generates a field, which is a script of the checked item
219 219
 		$node_count = count($field_node);
220
-		if($node_count)
220
+		if ($node_count)
221 221
 		{
222
-			foreach($field_node as $key => $node)
222
+			foreach ($field_node as $key => $node)
223 223
 			{
224 224
 				$attrs = $node->attrs;
225 225
 				$target = trim($attrs->target);
226 226
 
227
-				if(!$target)
227
+				if (!$target)
228 228
 				{
229 229
 					continue;
230 230
 				}
@@ -234,34 +234,34 @@  discard block
 block discarded – undo
234 234
 
235 235
 				$field = array();
236 236
 
237
-				if($attrs->required == 'true')
237
+				if ($attrs->required == 'true')
238 238
 				{
239 239
 					$field[] = 'required:true';
240 240
 				}
241
-				if($attrs->minlength > 0)
241
+				if ($attrs->minlength > 0)
242 242
 				{
243
-					$field[] = 'minlength:' . $attrs->minlength;
243
+					$field[] = 'minlength:'.$attrs->minlength;
244 244
 				}
245
-				if($attrs->maxlength > 0)
245
+				if ($attrs->maxlength > 0)
246 246
 				{
247
-					$field[] = 'maxlength:' . $attrs->maxlength;
247
+					$field[] = 'maxlength:'.$attrs->maxlength;
248 248
 				}
249
-				if($equalto)
249
+				if ($equalto)
250 250
 				{
251 251
 					$field[] = "equalto:'{$attrs->equalto}'";
252 252
 				}
253
-				if($rule)
253
+				if ($rule)
254 254
 				{
255 255
 					$field[] = "rule:'{$rule}'";
256 256
 				}
257 257
 
258
-				$fields[] = "'{$target}': {" . implode(',', $field) . "}";
258
+				$fields[] = "'{$target}': {".implode(',', $field)."}";
259 259
 
260
-				if(!in_array($target, $target_list))
260
+				if (!in_array($target, $target_list))
261 261
 				{
262 262
 					$target_list[] = $target;
263 263
 				}
264
-				if(!$target_type_list[$target])
264
+				if (!$target_type_list[$target])
265 265
 				{
266 266
 					$target_type_list[$target] = $filter;
267 267
 				}
@@ -271,12 +271,12 @@  discard block
 block discarded – undo
271 271
 		// Check extend_filter_item
272 272
 		$rule_types = array('homepage' => 'homepage', 'email_address' => 'email');
273 273
 
274
-		for($i = 0; $i < $extend_filter_count; $i++)
274
+		for ($i = 0; $i < $extend_filter_count; $i++)
275 275
 		{
276 276
 			$filter_item = $extend_filter_list[$i];
277 277
 			$target = trim($filter_item->name);
278 278
 
279
-			if(!$target)
279
+			if (!$target)
280 280
 			{
281 281
 				continue;
282 282
 			}
@@ -287,21 +287,21 @@  discard block
 block discarded – undo
287 287
 			$required = ($filter_item->required == 'true');
288 288
 
289 289
 			$field = array();
290
-			if($required)
290
+			if ($required)
291 291
 			{
292 292
 				$field[] = 'required:true';
293 293
 			}
294
-			if($rule)
294
+			if ($rule)
295 295
 			{
296 296
 				$field[] = "rule:'{$rule}'";
297 297
 			}
298
-			$fields[] = "\t\t'{$target}' : {" . implode(',', $field) . "}";
298
+			$fields[] = "\t\t'{$target}' : {".implode(',', $field)."}";
299 299
 
300
-			if(!in_array($target, $target_list))
300
+			if (!in_array($target, $target_list))
301 301
 			{
302 302
 				$target_list[] = $target;
303 303
 			}
304
-			if(!$target_type_list[$target])
304
+			if (!$target_type_list[$target])
305 305
 			{
306 306
 				$target_type_list[$target] = $type;
307 307
 			}
@@ -310,37 +310,37 @@  discard block
 block discarded – undo
310 310
 		// generates parameter script to create dbata
311 311
 		$rename_params = array();
312 312
 		$parameter_count = count($parameter_param);
313
-		if($parameter_count)
313
+		if ($parameter_count)
314 314
 		{
315 315
 			// contains parameter of the default filter contents
316
-			foreach($parameter_param as $key => $param)
316
+			foreach ($parameter_param as $key => $param)
317 317
 			{
318 318
 				$attrs = $param->attrs;
319 319
 				$name = trim($attrs->name);
320 320
 				$target = trim($attrs->target);
321 321
 
322 322
 				//if($name && $target && ($name != $target)) $js_doc[] = "\t\tparams['{$name}'] = params['{$target}']; delete params['{$target}'];";
323
-				if($name && $target && ($name != $target))
323
+				if ($name && $target && ($name != $target))
324 324
 				{
325 325
 					$rename_params[] = "'{$target}':'{$name}'";
326 326
 				}
327
-				if($name && !in_array($name, $target_list))
327
+				if ($name && !in_array($name, $target_list))
328 328
 				{
329 329
 					$target_list[] = $name;
330 330
 				}
331 331
 			}
332 332
 
333 333
 			// Check extend_filter_item
334
-			for($i = 0; $i < $extend_filter_count; $i++)
334
+			for ($i = 0; $i < $extend_filter_count; $i++)
335 335
 			{
336 336
 				$filter_item = $extend_filter_list[$i];
337 337
 				$target = $name = trim($filter_item->name);
338
-				if(!$name || !$target)
338
+				if (!$name || !$target)
339 339
 				{
340 340
 					continue;
341 341
 				}
342 342
 
343
-				if(!in_array($name, $target_list))
343
+				if (!in_array($name, $target_list))
344 344
 				{
345 345
 					$target_list[] = $name;
346 346
 				}
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 		// generates the response script
351 351
 		$response_count = count($response_tag);
352 352
 		$responses = array();
353
-		for($i = 0; $i < $response_count; $i++)
353
+		for ($i = 0; $i < $response_count; $i++)
354 354
 		{
355 355
 			$attrs = $response_tag[$i]->attrs;
356 356
 			$name = $attrs->name;
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 
360 360
 		// writes lang values of the form field
361 361
 		$target_count = count($target_list);
362
-		for($i = 0; $i < $target_count; $i++)
362
+		for ($i = 0; $i < $target_count; $i++)
363 363
 		{
364 364
 			$target = $target_list[$i];
365
-			if(!$lang->{$target})
365
+			if (!$lang->{$target})
366 366
 			{
367 367
 				$lang->{$target} = $target;
368 368
 			}
@@ -381,9 +381,9 @@  discard block
 block discarded – undo
381 381
 		 */
382 382
 
383 383
 		// writes error messages
384
-		foreach($lang->filter as $key => $val)
384
+		foreach ($lang->filter as $key => $val)
385 385
 		{
386
-			if(!$val)
386
+			if (!$val)
387 387
 			{
388 388
 				$val = $key;
389 389
 			}
@@ -392,24 +392,24 @@  discard block
 block discarded – undo
392 392
 		}
393 393
 
394 394
 		$callback_func = $xml_obj->filter->response->attrs->callback_func;
395
-		if(!$callback_func)
395
+		if (!$callback_func)
396 396
 		{
397 397
 			$callback_func = "filterAlertMessage";
398 398
 		}
399 399
 
400 400
 		$confirm_msg = '';
401
-		if($confirm_msg_code)
401
+		if ($confirm_msg_code)
402 402
 		{
403 403
 			$confirm_msg = $lang->{$confirm_msg_code};
404 404
 		}
405 405
 
406 406
 		$jsdoc = array();
407
-		$jsdoc[] = "function {$filter_name}(form){ return legacy_filter('{$filter_name}', form, '{$module}', '{$act}', {$callback_func}, [" . implode(',', $responses) . "], '" . addslashes($confirm_msg) . "', {" . implode(',', $rename_params) . "}) };";
407
+		$jsdoc[] = "function {$filter_name}(form){ return legacy_filter('{$filter_name}', form, '{$module}', '{$act}', {$callback_func}, [".implode(',', $responses)."], '".addslashes($confirm_msg)."', {".implode(',', $rename_params)."}) };";
408 408
 		$jsdoc[] = '(function($){';
409 409
 		$jsdoc[] = "\tvar v=xe.getApp('validator')[0];if(!v)return false;";
410
-		$jsdoc[] = "\t" . 'v.cast("ADD_FILTER", ["' . $filter_name . '", {' . implode(',', $fields) . '}]);';
411
-		$jsdoc[] = "\t" . implode("\n\t", $js_rules);
412
-		$jsdoc[] = "\t" . implode("\n\t", $js_messages);
410
+		$jsdoc[] = "\t".'v.cast("ADD_FILTER", ["'.$filter_name.'", {'.implode(',', $fields).'}]);';
411
+		$jsdoc[] = "\t".implode("\n\t", $js_rules);
412
+		$jsdoc[] = "\t".implode("\n\t", $js_messages);
413 413
 		$jsdoc[] = '})(jQuery);';
414 414
 		$jsdoc = implode("\n", $jsdoc);
415 415
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 	 */
425 425
 	function _getCompiledFileName($xml_file)
426 426
 	{
427
-		return sprintf('%s%s.%s.compiled.js', $this->compiled_path, md5($this->version . $xml_file), Context::getLangType());
427
+		return sprintf('%s%s.%s.compiled.js', $this->compiled_path, md5($this->version.$xml_file), Context::getLangType());
428 428
 	}
429 429
 
430 430
 }
Please login to merge, or discard this patch.
classes/xml/xmlquery/DBParser.class.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,8 +66,7 @@  discard block
 block discarded – undo
66 66
 		if($escape_char_right !== "")
67 67
 		{
68 68
 			$this->escape_char_right = $escape_char_right;
69
-		}
70
-		else
69
+		} else
71 70
 		{
72 71
 			$this->escape_char_right = $escape_char_left;
73 72
 		}
@@ -85,8 +84,7 @@  discard block
 block discarded – undo
85 84
 		if($leftOrRight === 'left')
86 85
 		{
87 86
 			return $this->escape_char_left;
88
-		}
89
-		else
87
+		} else
90 88
 		{
91 89
 			return $this->escape_char_right;
92 90
 		}
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	function DBParser($escape_char_left, $escape_char_right = "", $table_prefix = "xe_")
64 64
 	{
65 65
 		$this->escape_char_left = $escape_char_left;
66
-		if($escape_char_right !== "")
66
+		if ($escape_char_right !== "")
67 67
 		{
68 68
 			$this->escape_char_right = $escape_char_right;
69 69
 		}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	function getEscapeChar($leftOrRight)
84 84
 	{
85
-		if($leftOrRight === 'left')
85
+		if ($leftOrRight === 'left')
86 86
 		{
87 87
 			return $this->escape_char_left;
88 88
 		}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	function escape($name)
102 102
 	{
103
-		return $this->escape_char_left . $name . $this->escape_char_right;
103
+		return $this->escape_char_left.$name.$this->escape_char_right;
104 104
 	}
105 105
 
106 106
 	/**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	function escapeString($name)
113 113
 	{
114
-		return "'" . $this->escapeStringValue($name) . "'";
114
+		return "'".$this->escapeStringValue($name)."'";
115 115
 	}
116 116
 
117 117
 	/**
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	function escapeStringValue($value)
124 124
 	{
125
-		if($value == "*")
125
+		if ($value == "*")
126 126
 		{
127 127
 			return $value;
128 128
 		}
129
-		if(is_string($value))
129
+		if (is_string($value))
130 130
 		{
131 131
 			return $value = str_replace("'", "''", $value);
132 132
 		}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	function parseTableName($name)
144 144
 	{
145
-		return $this->table_prefix . $name;
145
+		return $this->table_prefix.$name;
146 146
 	}
147 147
 
148 148
 	/**
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	function escapeColumn($column_name)
167 167
 	{
168
-		if($this->isUnqualifiedColumnName($column_name))
168
+		if ($this->isUnqualifiedColumnName($column_name))
169 169
 		{
170 170
 			return $this->escape($column_name);
171 171
 		}
172
-		if($this->isQualifiedColumnName($column_name))
172
+		if ($this->isQualifiedColumnName($column_name))
173 173
 		{
174 174
 			list($table, $column) = explode('.', $column_name);
175 175
 			// $table can also be an alias, so the prefix should not be added
176
-			return $this->escape($table) . '.' . $this->escape($column);
176
+			return $this->escape($table).'.'.$this->escape($column);
177 177
 			//return $this->escape($this->parseTableName($table)).'.'.$this->escape($column);
178 178
 		}
179 179
 	}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	function isUnqualifiedColumnName($column_name)
191 191
 	{
192
-		if(strpos($column_name, '.') === FALSE && strpos($column_name, '(') === FALSE)
192
+		if (strpos($column_name, '.') === FALSE && strpos($column_name, '(') === FALSE)
193 193
 		{
194 194
 			return TRUE;
195 195
 		}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	function isQualifiedColumnName($column_name)
209 209
 	{
210
-		if(strpos($column_name, '.') !== FALSE && strpos($column_name, '(') === FALSE)
210
+		if (strpos($column_name, '.') !== FALSE && strpos($column_name, '(') === FALSE)
211 211
 		{
212 212
 			return TRUE;
213 213
 		}
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
 	function parseExpression($column_name)
236 236
 	{
237 237
 		$functions = preg_split('/([\+\-\*\/\ ])/', $column_name, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
238
-		foreach($functions as $k => $v)
238
+		foreach ($functions as $k => $v)
239 239
 		{
240 240
 			$function = &$functions[$k];
241
-			if(strlen($function) == 1)
241
+			if (strlen($function) == 1)
242 242
 			{
243 243
 				continue; // skip delimiters
244 244
 			}
@@ -246,25 +246,25 @@  discard block
 block discarded – undo
246 246
 			$matches = preg_split('/([a-zA-Z0-9_*]+)/', $function, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
247 247
 			$total_brackets = substr_count($function, "(");
248 248
 			$brackets = 0;
249
-			foreach($matches as $i => $j)
249
+			foreach ($matches as $i => $j)
250 250
 			{
251 251
 				$match = &$matches[$i];
252
-				if($match == '(')
252
+				if ($match == '(')
253 253
 				{
254 254
 					$brackets++;
255 255
 					continue;
256 256
 				}
257
-				if(strpos($match, ')') !== FALSE)
257
+				if (strpos($match, ')') !== FALSE)
258 258
 				{
259 259
 					continue;
260 260
 				}
261
-				if(in_array($match, array(',', '.')))
261
+				if (in_array($match, array(',', '.')))
262 262
 				{
263 263
 					continue;
264 264
 				}
265
-				if($brackets == $total_brackets)
265
+				if ($brackets == $total_brackets)
266 266
 				{
267
-					if(!is_numeric($match) && !in_array(strtoupper($match), array('UNSIGNED', 'INTEGER', 'AS')))
267
+					if (!is_numeric($match) && !in_array(strtoupper($match), array('UNSIGNED', 'INTEGER', 'AS')))
268 268
 					{
269 269
 						$match = $this->escapeColumnExpression($match);
270 270
 					}
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 	 */
284 284
 	function isStar($column_name)
285 285
 	{
286
-		if(substr($column_name, -1) == '*')
286
+		if (substr($column_name, -1) == '*')
287 287
 		{
288 288
 			return TRUE;
289 289
 		}
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 */
300 300
 	function isStarFunction($column_name)
301 301
 	{
302
-		if(strpos($column_name, "(*)") !== FALSE)
302
+		if (strpos($column_name, "(*)") !== FALSE)
303 303
 		{
304 304
 			return TRUE;
305 305
 		}
@@ -313,15 +313,15 @@  discard block
 block discarded – undo
313 313
 	 */
314 314
 	function escapeColumnExpression($column_name)
315 315
 	{
316
-		if($this->isStar($column_name))
316
+		if ($this->isStar($column_name))
317 317
 		{
318 318
 			return $column_name;
319 319
 		}
320
-		if($this->isStarFunction($column_name))
320
+		if ($this->isStarFunction($column_name))
321 321
 		{
322 322
 			return $column_name;
323 323
 		}
324
-		if(stripos($column_name, 'distinct') !== FALSE)
324
+		if (stripos($column_name, 'distinct') !== FALSE)
325 325
 		{
326 326
 			return $column_name;
327 327
 		}
Please login to merge, or discard this patch.