35 abstract public function validate($string, $config, $context);
59 $string = trim($string);
60 $string = str_replace(array(
"\n",
"\t",
"\r"),
' ', $string);
69 public function make($string) {
82 return preg_replace(
'/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\)/',
'rgb(\1,\2,\3)', $string);
92 for ($i = 0, $c = strlen($string); $i < $c; $i++) {
93 if ($string[$i] ===
'\\') {
99 if (ctype_xdigit($string[$i])) {
101 for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) {
102 if (!ctype_xdigit($string[$i]))
break;
103 $code .= $string[$i];
111 if ($i < $c && trim($string[$i]) !==
'') $i--;
114 if ($string[$i] ===
"\n")
continue;
Base class for all validating attribute definitions.
static unichr($code)
Translates a Unicode codepoint into its corresponding UTF-8 character.
static cleanUTF8($str, $force_php=false)
Cleans a UTF-8 string for well-formedness and SGML validity.
validate($string, $config, $context)
Validates and cleans passed string according to a definition.
make($string)
Factory method for creating this class from a string.
parseCDATA($string)
Convenience method that parses a string as if it were CDATA.
expandCSSEscape($string)
Parses a possibly escaped CSS string and returns the "pure" version of it.
$minimized
Tells us whether or not an HTML attribute is minimized.
$required
Tells us whether or not an HTML attribute is required.
mungeRgb($string)
Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly.