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 — master ( b130b6...8a2f54 )
by gyeong-won
07:36
created
classes/security/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php 3 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -6,63 +6,63 @@
 block discarded – undo
6 6
 class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef
7 7
 {
8 8
 
9
-    /**
10
-     * Bool indicating whether or not only positive values allowed.
11
-     */
12
-    protected $non_negative = false;
13
-
14
-    /**
15
-     * @param $non_negative Bool indicating whether negatives are forbidden
16
-     */
17
-    public function __construct($non_negative = false) {
18
-        $this->non_negative = $non_negative;
19
-    }
20
-
21
-    /**
22
-     * @warning Some contexts do not pass $config, $context. These
23
-     *          variables should not be used without checking HTMLPurifier_Length
24
-     */
25
-    public function validate($number, $config, $context) {
26
-
27
-        $number = $this->parseCDATA($number);
28
-
29
-        if ($number === '') return false;
30
-        if ($number === '0') return '0';
31
-
32
-        $sign = '';
33
-        switch ($number[0]) {
34
-            case '-':
35
-                if ($this->non_negative) return false;
36
-                $sign = '-';
37
-            case '+':
38
-                $number = substr($number, 1);
39
-        }
40
-
41
-        if (ctype_digit($number)) {
42
-            $number = ltrim($number, '0');
43
-            return $number ? $sign . $number : '0';
44
-        }
45
-
46
-        // Period is the only non-numeric character allowed
47
-        if (strpos($number, '.') === false) return false;
48
-
49
-        list($left, $right) = explode('.', $number, 2);
50
-
51
-        if ($left === '' && $right === '') return false;
52
-        if ($left !== '' && !ctype_digit($left)) return false;
53
-
54
-        $left  = ltrim($left,  '0');
55
-        $right = rtrim($right, '0');
56
-
57
-        if ($right === '') {
58
-            return $left ? $sign . $left : '0';
59
-        } elseif (!ctype_digit($right)) {
60
-            return false;
61
-        }
62
-
63
-        return $sign . $left . '.' . $right;
64
-
65
-    }
9
+	/**
10
+	 * Bool indicating whether or not only positive values allowed.
11
+	 */
12
+	protected $non_negative = false;
13
+
14
+	/**
15
+	 * @param $non_negative Bool indicating whether negatives are forbidden
16
+	 */
17
+	public function __construct($non_negative = false) {
18
+		$this->non_negative = $non_negative;
19
+	}
20
+
21
+	/**
22
+	 * @warning Some contexts do not pass $config, $context. These
23
+	 *          variables should not be used without checking HTMLPurifier_Length
24
+	 */
25
+	public function validate($number, $config, $context) {
26
+
27
+		$number = $this->parseCDATA($number);
28
+
29
+		if ($number === '') return false;
30
+		if ($number === '0') return '0';
31
+
32
+		$sign = '';
33
+		switch ($number[0]) {
34
+			case '-':
35
+				if ($this->non_negative) return false;
36
+				$sign = '-';
37
+			case '+':
38
+				$number = substr($number, 1);
39
+		}
40
+
41
+		if (ctype_digit($number)) {
42
+			$number = ltrim($number, '0');
43
+			return $number ? $sign . $number : '0';
44
+		}
45
+
46
+		// Period is the only non-numeric character allowed
47
+		if (strpos($number, '.') === false) return false;
48
+
49
+		list($left, $right) = explode('.', $number, 2);
50
+
51
+		if ($left === '' && $right === '') return false;
52
+		if ($left !== '' && !ctype_digit($left)) return false;
53
+
54
+		$left  = ltrim($left,  '0');
55
+		$right = rtrim($right, '0');
56
+
57
+		if ($right === '') {
58
+			return $left ? $sign . $left : '0';
59
+		} elseif (!ctype_digit($right)) {
60
+			return false;
61
+		}
62
+
63
+		return $sign . $left . '.' . $right;
64
+
65
+	}
66 66
 
67 67
 }
68 68
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,13 +26,19 @@  discard block
 block discarded – undo
26 26
 
27 27
         $number = $this->parseCDATA($number);
28 28
 
29
-        if ($number === '') return false;
30
-        if ($number === '0') return '0';
29
+        if ($number === '') {
30
+        	return false;
31
+        }
32
+        if ($number === '0') {
33
+        	return '0';
34
+        }
31 35
 
32 36
         $sign = '';
33 37
         switch ($number[0]) {
34 38
             case '-':
35
-                if ($this->non_negative) return false;
39
+                if ($this->non_negative) {
40
+                	return false;
41
+                }
36 42
                 $sign = '-';
37 43
             case '+':
38 44
                 $number = substr($number, 1);
@@ -44,12 +50,18 @@  discard block
 block discarded – undo
44 50
         }
45 51
 
46 52
         // Period is the only non-numeric character allowed
47
-        if (strpos($number, '.') === false) return false;
53
+        if (strpos($number, '.') === false) {
54
+        	return false;
55
+        }
48 56
 
49 57
         list($left, $right) = explode('.', $number, 2);
50 58
 
51
-        if ($left === '' && $right === '') return false;
52
-        if ($left !== '' && !ctype_digit($left)) return false;
59
+        if ($left === '' && $right === '') {
60
+        	return false;
61
+        }
62
+        if ($left !== '' && !ctype_digit($left)) {
63
+        	return false;
64
+        }
53 65
 
54 66
         $left  = ltrim($left,  '0');
55 67
         $right = rtrim($right, '0');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         if (ctype_digit($number)) {
42 42
             $number = ltrim($number, '0');
43
-            return $number ? $sign . $number : '0';
43
+            return $number ? $sign.$number : '0';
44 44
         }
45 45
 
46 46
         // Period is the only non-numeric character allowed
@@ -51,16 +51,16 @@  discard block
 block discarded – undo
51 51
         if ($left === '' && $right === '') return false;
52 52
         if ($left !== '' && !ctype_digit($left)) return false;
53 53
 
54
-        $left  = ltrim($left,  '0');
54
+        $left  = ltrim($left, '0');
55 55
         $right = rtrim($right, '0');
56 56
 
57 57
         if ($right === '') {
58
-            return $left ? $sign . $left : '0';
58
+            return $left ? $sign.$left : '0';
59 59
         } elseif (!ctype_digit($right)) {
60 60
             return false;
61 61
         }
62 62
 
63
-        return $sign . $left . '.' . $right;
63
+        return $sign.$left.'.'.$right;
64 64
 
65 65
     }
66 66
 
Please login to merge, or discard this patch.
security/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,34 +6,34 @@
 block discarded – undo
6 6
 class HTMLPurifier_AttrDef_CSS_Percentage extends HTMLPurifier_AttrDef
7 7
 {
8 8
 
9
-    /**
10
-     * Instance of HTMLPurifier_AttrDef_CSS_Number to defer number validation
11
-     */
12
-    protected $number_def;
9
+	/**
10
+	 * Instance of HTMLPurifier_AttrDef_CSS_Number to defer number validation
11
+	 */
12
+	protected $number_def;
13 13
 
14
-    /**
15
-     * @param Bool indicating whether to forbid negative values
16
-     */
17
-    public function __construct($non_negative = false) {
18
-        $this->number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative);
19
-    }
14
+	/**
15
+	 * @param Bool indicating whether to forbid negative values
16
+	 */
17
+	public function __construct($non_negative = false) {
18
+		$this->number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative);
19
+	}
20 20
 
21
-    public function validate($string, $config, $context) {
21
+	public function validate($string, $config, $context) {
22 22
 
23
-        $string = $this->parseCDATA($string);
23
+		$string = $this->parseCDATA($string);
24 24
 
25
-        if ($string === '') return false;
26
-        $length = strlen($string);
27
-        if ($length === 1) return false;
28
-        if ($string[$length - 1] !== '%') return false;
25
+		if ($string === '') return false;
26
+		$length = strlen($string);
27
+		if ($length === 1) return false;
28
+		if ($string[$length - 1] !== '%') return false;
29 29
 
30
-        $number = substr($string, 0, $length - 1);
31
-        $number = $this->number_def->validate($number, $config, $context);
30
+		$number = substr($string, 0, $length - 1);
31
+		$number = $this->number_def->validate($number, $config, $context);
32 32
 
33
-        if ($number === false) return false;
34
-        return "$number%";
33
+		if ($number === false) return false;
34
+		return "$number%";
35 35
 
36
-    }
36
+	}
37 37
 
38 38
 }
39 39
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,15 +22,23 @@
 block discarded – undo
22 22
 
23 23
         $string = $this->parseCDATA($string);
24 24
 
25
-        if ($string === '') return false;
25
+        if ($string === '') {
26
+        	return false;
27
+        }
26 28
         $length = strlen($string);
27
-        if ($length === 1) return false;
28
-        if ($string[$length - 1] !== '%') return false;
29
+        if ($length === 1) {
30
+        	return false;
31
+        }
32
+        if ($string[$length - 1] !== '%') {
33
+        	return false;
34
+        }
29 35
 
30 36
         $number = substr($string, 0, $length - 1);
31 37
         $number = $this->number_def->validate($number, $config, $context);
32 38
 
33
-        if ($number === false) return false;
39
+        if ($number === false) {
40
+        	return false;
41
+        }
34 42
         return "$number%";
35 43
 
36 44
     }
Please login to merge, or discard this patch.
security/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php 3 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,30 +8,30 @@
 block discarded – undo
8 8
 class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef
9 9
 {
10 10
 
11
-    public function validate($string, $config, $context) {
12
-
13
-        static $allowed_values = array(
14
-            'line-through' => true,
15
-            'overline' => true,
16
-            'underline' => true,
17
-        );
18
-
19
-        $string = strtolower($this->parseCDATA($string));
20
-
21
-        if ($string === 'none') return $string;
22
-
23
-        $parts = explode(' ', $string);
24
-        $final = '';
25
-        foreach ($parts as $part) {
26
-            if (isset($allowed_values[$part])) {
27
-                $final .= $part . ' ';
28
-            }
29
-        }
30
-        $final = rtrim($final);
31
-        if ($final === '') return false;
32
-        return $final;
33
-
34
-    }
11
+	public function validate($string, $config, $context) {
12
+
13
+		static $allowed_values = array(
14
+			'line-through' => true,
15
+			'overline' => true,
16
+			'underline' => true,
17
+		);
18
+
19
+		$string = strtolower($this->parseCDATA($string));
20
+
21
+		if ($string === 'none') return $string;
22
+
23
+		$parts = explode(' ', $string);
24
+		$final = '';
25
+		foreach ($parts as $part) {
26
+			if (isset($allowed_values[$part])) {
27
+				$final .= $part . ' ';
28
+			}
29
+		}
30
+		$final = rtrim($final);
31
+		if ($final === '') return false;
32
+		return $final;
33
+
34
+	}
35 35
 
36 36
 }
37 37
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@  discard block
 block discarded – undo
18 18
 
19 19
         $string = strtolower($this->parseCDATA($string));
20 20
 
21
-        if ($string === 'none') return $string;
21
+        if ($string === 'none') {
22
+        	return $string;
23
+        }
22 24
 
23 25
         $parts = explode(' ', $string);
24 26
         $final = '';
@@ -28,7 +30,9 @@  discard block
 block discarded – undo
28 30
             }
29 31
         }
30 32
         $final = rtrim($final);
31
-        if ($final === '') return false;
33
+        if ($final === '') {
34
+        	return false;
35
+        }
32 36
         return $final;
33 37
 
34 38
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $final = '';
25 25
         foreach ($parts as $part) {
26 26
             if (isset($allowed_values[$part])) {
27
-                $final .= $part . ' ';
27
+                $final .= $part.' ';
28 28
             }
29 29
         }
30 30
         $final = rtrim($final);
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -12,49 +12,49 @@
 block discarded – undo
12 12
 class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI
13 13
 {
14 14
 
15
-    public function __construct() {
16
-        parent::__construct(true); // always embedded
17
-    }
15
+	public function __construct() {
16
+		parent::__construct(true); // always embedded
17
+	}
18 18
 
19
-    public function validate($uri_string, $config, $context) {
20
-        // parse the URI out of the string and then pass it onto
21
-        // the parent object
19
+	public function validate($uri_string, $config, $context) {
20
+		// parse the URI out of the string and then pass it onto
21
+		// the parent object
22 22
 
23
-        $uri_string = $this->parseCDATA($uri_string);
24
-        if (strpos($uri_string, 'url(') !== 0) return false;
25
-        $uri_string = substr($uri_string, 4);
26
-        $new_length = strlen($uri_string) - 1;
27
-        if ($uri_string[$new_length] != ')') return false;
28
-        $uri = trim(substr($uri_string, 0, $new_length));
23
+		$uri_string = $this->parseCDATA($uri_string);
24
+		if (strpos($uri_string, 'url(') !== 0) return false;
25
+		$uri_string = substr($uri_string, 4);
26
+		$new_length = strlen($uri_string) - 1;
27
+		if ($uri_string[$new_length] != ')') return false;
28
+		$uri = trim(substr($uri_string, 0, $new_length));
29 29
 
30
-        if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) {
31
-            $quote = $uri[0];
32
-            $new_length = strlen($uri) - 1;
33
-            if ($uri[$new_length] !== $quote) return false;
34
-            $uri = substr($uri, 1, $new_length - 1);
35
-        }
30
+		if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) {
31
+			$quote = $uri[0];
32
+			$new_length = strlen($uri) - 1;
33
+			if ($uri[$new_length] !== $quote) return false;
34
+			$uri = substr($uri, 1, $new_length - 1);
35
+		}
36 36
 
37
-        $uri = $this->expandCSSEscape($uri);
37
+		$uri = $this->expandCSSEscape($uri);
38 38
 
39
-        $result = parent::validate($uri, $config, $context);
39
+		$result = parent::validate($uri, $config, $context);
40 40
 
41
-        if ($result === false) return false;
41
+		if ($result === false) return false;
42 42
 
43
-        // extra sanity check; should have been done by URI
44
-        $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result);
43
+		// extra sanity check; should have been done by URI
44
+		$result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result);
45 45
 
46
-        // suspicious characters are ()'; we're going to percent encode
47
-        // them for safety.
48
-        $result = str_replace(array('(', ')', "'"), array('%28', '%29', '%27'), $result);
46
+		// suspicious characters are ()'; we're going to percent encode
47
+		// them for safety.
48
+		$result = str_replace(array('(', ')', "'"), array('%28', '%29', '%27'), $result);
49 49
 
50
-        // there's an extra bug where ampersands lose their escaping on
51
-        // an innerHTML cycle, so a very unlucky query parameter could
52
-        // then change the meaning of the URL.  Unfortunately, there's
53
-        // not much we can do about that...
50
+		// there's an extra bug where ampersands lose their escaping on
51
+		// an innerHTML cycle, so a very unlucky query parameter could
52
+		// then change the meaning of the URL.  Unfortunately, there's
53
+		// not much we can do about that...
54 54
 
55
-        return "url(\"$result\")";
55
+		return "url(\"$result\")";
56 56
 
57
-    }
57
+	}
58 58
 
59 59
 }
60 60
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,16 +21,22 @@  discard block
 block discarded – undo
21 21
         // the parent object
22 22
 
23 23
         $uri_string = $this->parseCDATA($uri_string);
24
-        if (strpos($uri_string, 'url(') !== 0) return false;
24
+        if (strpos($uri_string, 'url(') !== 0) {
25
+        	return false;
26
+        }
25 27
         $uri_string = substr($uri_string, 4);
26 28
         $new_length = strlen($uri_string) - 1;
27
-        if ($uri_string[$new_length] != ')') return false;
29
+        if ($uri_string[$new_length] != ')') {
30
+        	return false;
31
+        }
28 32
         $uri = trim(substr($uri_string, 0, $new_length));
29 33
 
30 34
         if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) {
31 35
             $quote = $uri[0];
32 36
             $new_length = strlen($uri) - 1;
33
-            if ($uri[$new_length] !== $quote) return false;
37
+            if ($uri[$new_length] !== $quote) {
38
+            	return false;
39
+            }
34 40
             $uri = substr($uri, 1, $new_length - 1);
35 41
         }
36 42
 
@@ -38,7 +44,9 @@  discard block
 block discarded – undo
38 44
 
39 45
         $result = parent::validate($uri, $config, $context);
40 46
 
41
-        if ($result === false) return false;
47
+        if ($result === false) {
48
+        	return false;
49
+        }
42 50
 
43 51
         // extra sanity check; should have been done by URI
44 52
         $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result);
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@
 block discarded – undo
6 6
  */
7 7
 class HTMLPurifier_AttrDef_Clone extends HTMLPurifier_AttrDef
8 8
 {
9
-    /**
10
-     * What we're cloning
11
-     */
12
-    protected $clone;
9
+	/**
10
+	 * What we're cloning
11
+	 */
12
+	protected $clone;
13 13
 
14
-    public function __construct($clone) {
15
-        $this->clone = $clone;
16
-    }
14
+	public function __construct($clone) {
15
+		$this->clone = $clone;
16
+	}
17 17
 
18
-    public function validate($v, $config, $context) {
19
-        return $this->clone->validate($v, $config, $context);
20
-    }
18
+	public function validate($v, $config, $context) {
19
+		return $this->clone->validate($v, $config, $context);
20
+	}
21 21
 
22
-    public function make($string) {
23
-        return clone $this->clone;
24
-    }
22
+	public function make($string) {
23
+		return clone $this->clone;
24
+	}
25 25
 
26 26
 }
27 27
 
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -10,55 +10,55 @@
 block discarded – undo
10 10
 class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef
11 11
 {
12 12
 
13
-    /**
14
-     * Lookup table of valid values.
15
-     * @todo Make protected
16
-     */
17
-    public $valid_values   = array();
13
+	/**
14
+	 * Lookup table of valid values.
15
+	 * @todo Make protected
16
+	 */
17
+	public $valid_values   = array();
18 18
 
19
-    /**
20
-     * Bool indicating whether or not enumeration is case sensitive.
21
-     * @note In general this is always case insensitive.
22
-     */
23
-    protected $case_sensitive = false; // values according to W3C spec
19
+	/**
20
+	 * Bool indicating whether or not enumeration is case sensitive.
21
+	 * @note In general this is always case insensitive.
22
+	 */
23
+	protected $case_sensitive = false; // values according to W3C spec
24 24
 
25
-    /**
26
-     * @param $valid_values List of valid values
27
-     * @param $case_sensitive Bool indicating whether or not case sensitive
28
-     */
29
-    public function __construct(
30
-        $valid_values = array(), $case_sensitive = false
31
-    ) {
32
-        $this->valid_values = array_flip($valid_values);
33
-        $this->case_sensitive = $case_sensitive;
34
-    }
25
+	/**
26
+	 * @param $valid_values List of valid values
27
+	 * @param $case_sensitive Bool indicating whether or not case sensitive
28
+	 */
29
+	public function __construct(
30
+		$valid_values = array(), $case_sensitive = false
31
+	) {
32
+		$this->valid_values = array_flip($valid_values);
33
+		$this->case_sensitive = $case_sensitive;
34
+	}
35 35
 
36
-    public function validate($string, $config, $context) {
37
-        $string = trim($string);
38
-        if (!$this->case_sensitive) {
39
-            // we may want to do full case-insensitive libraries
40
-            $string = ctype_lower($string) ? $string : strtolower($string);
41
-        }
42
-        $result = isset($this->valid_values[$string]);
36
+	public function validate($string, $config, $context) {
37
+		$string = trim($string);
38
+		if (!$this->case_sensitive) {
39
+			// we may want to do full case-insensitive libraries
40
+			$string = ctype_lower($string) ? $string : strtolower($string);
41
+		}
42
+		$result = isset($this->valid_values[$string]);
43 43
 
44
-        return $result ? $string : false;
45
-    }
44
+		return $result ? $string : false;
45
+	}
46 46
 
47
-    /**
48
-     * @param $string In form of comma-delimited list of case-insensitive
49
-     *      valid values. Example: "foo,bar,baz". Prepend "s:" to make
50
-     *      case sensitive
51
-     */
52
-    public function make($string) {
53
-        if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') {
54
-            $string = substr($string, 2);
55
-            $sensitive = true;
56
-        } else {
57
-            $sensitive = false;
58
-        }
59
-        $values = explode(',', $string);
60
-        return new HTMLPurifier_AttrDef_Enum($values, $sensitive);
61
-    }
47
+	/**
48
+	 * @param $string In form of comma-delimited list of case-insensitive
49
+	 *      valid values. Example: "foo,bar,baz". Prepend "s:" to make
50
+	 *      case sensitive
51
+	 */
52
+	public function make($string) {
53
+		if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') {
54
+			$string = substr($string, 2);
55
+			$sensitive = true;
56
+		} else {
57
+			$sensitive = false;
58
+		}
59
+		$values = explode(',', $string);
60
+		return new HTMLPurifier_AttrDef_Enum($values, $sensitive);
61
+	}
62 62
 
63 63
 }
64 64
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      * Lookup table of valid values.
15 15
      * @todo Make protected
16 16
      */
17
-    public $valid_values   = array();
17
+    public $valid_values = array();
18 18
 
19 19
     /**
20 20
      * Bool indicating whether or not enumeration is case sensitive.
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@
 block discarded – undo
6 6
 class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
7 7
 {
8 8
 
9
-    protected $name;
10
-    public $minimized = true;
9
+	protected $name;
10
+	public $minimized = true;
11 11
 
12
-    public function __construct($name = false) {$this->name = $name;}
12
+	public function __construct($name = false) {$this->name = $name;}
13 13
 
14
-    public function validate($string, $config, $context) {
15
-        if (empty($string)) return false;
16
-        return $this->name;
17
-    }
14
+	public function validate($string, $config, $context) {
15
+		if (empty($string)) return false;
16
+		return $this->name;
17
+	}
18 18
 
19
-    /**
20
-     * @param $string Name of attribute
21
-     */
22
-    public function make($string) {
23
-        return new HTMLPurifier_AttrDef_HTML_Bool($string);
24
-    }
19
+	/**
20
+	 * @param $string Name of attribute
21
+	 */
22
+	public function make($string) {
23
+		return new HTMLPurifier_AttrDef_HTML_Bool($string);
24
+	}
25 25
 
26 26
 }
27 27
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     protected $name;
10 10
     public $minimized = true;
11 11
 
12
-    public function __construct($name = false) {$this->name = $name;}
12
+    public function __construct($name = false) {$this->name = $name; }
13 13
 
14 14
     public function validate($string, $config, $context) {
15 15
         if (empty($string)) return false;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
     public function __construct($name = false) {$this->name = $name;}
13 13
 
14 14
     public function validate($string, $config, $context) {
15
-        if (empty($string)) return false;
15
+        if (empty($string)) {
16
+        	return false;
17
+        }
16 18
         return $this->name;
17 19
     }
18 20
 
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -5,30 +5,30 @@
 block discarded – undo
5 5
  */
6 6
 class HTMLPurifier_AttrDef_HTML_Class extends HTMLPurifier_AttrDef_HTML_Nmtokens
7 7
 {
8
-    protected function split($string, $config, $context) {
9
-        // really, this twiddle should be lazy loaded
10
-        $name = $config->getDefinition('HTML')->doctype->name;
11
-        if ($name == "XHTML 1.1" || $name == "XHTML 2.0") {
12
-            return parent::split($string, $config, $context);
13
-        } else {
14
-            return preg_split('/\s+/', $string);
15
-        }
16
-    }
17
-    protected function filter($tokens, $config, $context) {
18
-        $allowed = $config->get('Attr.AllowedClasses');
19
-        $forbidden = $config->get('Attr.ForbiddenClasses');
20
-        $ret = array();
21
-        foreach ($tokens as $token) {
22
-            if (
23
-                ($allowed === null || isset($allowed[$token])) &&
24
-                !isset($forbidden[$token]) &&
25
-                // We need this O(n) check because of PHP's array
26
-                // implementation that casts -0 to 0.
27
-                !in_array($token, $ret, true)
28
-            ) {
29
-                $ret[] = $token;
30
-            }
31
-        }
32
-        return $ret;
33
-    }
8
+	protected function split($string, $config, $context) {
9
+		// really, this twiddle should be lazy loaded
10
+		$name = $config->getDefinition('HTML')->doctype->name;
11
+		if ($name == "XHTML 1.1" || $name == "XHTML 2.0") {
12
+			return parent::split($string, $config, $context);
13
+		} else {
14
+			return preg_split('/\s+/', $string);
15
+		}
16
+	}
17
+	protected function filter($tokens, $config, $context) {
18
+		$allowed = $config->get('Attr.AllowedClasses');
19
+		$forbidden = $config->get('Attr.ForbiddenClasses');
20
+		$ret = array();
21
+		foreach ($tokens as $token) {
22
+			if (
23
+				($allowed === null || isset($allowed[$token])) &&
24
+				!isset($forbidden[$token]) &&
25
+				// We need this O(n) check because of PHP's array
26
+				// implementation that casts -0 to 0.
27
+				!in_array($token, $ret, true)
28
+			) {
29
+				$ret[] = $token;
30
+			}
31
+		}
32
+		return $ret;
33
+	}
34 34
 }
Please login to merge, or discard this patch.
classes/security/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@
 block discarded – undo
6 6
 class HTMLPurifier_AttrDef_HTML_Color extends HTMLPurifier_AttrDef
7 7
 {
8 8
 
9
-    public function validate($string, $config, $context) {
9
+	public function validate($string, $config, $context) {
10 10
 
11
-        static $colors = null;
12
-        if ($colors === null) $colors = $config->get('Core.ColorKeywords');
11
+		static $colors = null;
12
+		if ($colors === null) $colors = $config->get('Core.ColorKeywords');
13 13
 
14
-        $string = trim($string);
14
+		$string = trim($string);
15 15
 
16
-        if (empty($string)) return false;
17
-        if (isset($colors[strtolower($string)])) return $colors[$string];
18
-        if ($string[0] === '#') $hex = substr($string, 1);
19
-        else $hex = $string;
16
+		if (empty($string)) return false;
17
+		if (isset($colors[strtolower($string)])) return $colors[$string];
18
+		if ($string[0] === '#') $hex = substr($string, 1);
19
+		else $hex = $string;
20 20
 
21
-        $length = strlen($hex);
22
-        if ($length !== 3 && $length !== 6) return false;
23
-        if (!ctype_xdigit($hex)) return false;
24
-        if ($length === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2];
21
+		$length = strlen($hex);
22
+		if ($length !== 3 && $length !== 6) return false;
23
+		if (!ctype_xdigit($hex)) return false;
24
+		if ($length === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2];
25 25
 
26
-        return "#$hex";
26
+		return "#$hex";
27 27
 
28
-    }
28
+	}
29 29
 
30 30
 }
31 31
 
Please login to merge, or discard this patch.
Braces   +23 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,19 +9,34 @@
 block discarded – undo
9 9
     public function validate($string, $config, $context) {
10 10
 
11 11
         static $colors = null;
12
-        if ($colors === null) $colors = $config->get('Core.ColorKeywords');
12
+        if ($colors === null) {
13
+        	$colors = $config->get('Core.ColorKeywords');
14
+        }
13 15
 
14 16
         $string = trim($string);
15 17
 
16
-        if (empty($string)) return false;
17
-        if (isset($colors[strtolower($string)])) return $colors[$string];
18
-        if ($string[0] === '#') $hex = substr($string, 1);
19
-        else $hex = $string;
18
+        if (empty($string)) {
19
+        	return false;
20
+        }
21
+        if (isset($colors[strtolower($string)])) {
22
+        	return $colors[$string];
23
+        }
24
+        if ($string[0] === '#') {
25
+        	$hex = substr($string, 1);
26
+        } else {
27
+        	$hex = $string;
28
+        }
20 29
 
21 30
         $length = strlen($hex);
22
-        if ($length !== 3 && $length !== 6) return false;
23
-        if (!ctype_xdigit($hex)) return false;
24
-        if ($length === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2];
31
+        if ($length !== 3 && $length !== 6) {
32
+        	return false;
33
+        }
34
+        if (!ctype_xdigit($hex)) {
35
+        	return false;
36
+        }
37
+        if ($length === 3) {
38
+        	$hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2];
39
+        }
25 40
 
26 41
         return "#$hex";
27 42
 
Please login to merge, or discard this patch.