ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
AttrDef.php
Go to the documentation of this file.
1 <?php
2 
13 abstract class HTMLPurifier_AttrDef
14 {
15 
20  public $minimized = false;
21 
26  public $required = false;
27 
35  abstract public function validate($string, $config, $context);
36 
58  public function parseCDATA($string) {
59  $string = trim($string);
60  $string = str_replace(array("\n", "\t", "\r"), ' ', $string);
61  return $string;
62  }
63 
69  public function make($string) {
70  // default implementation, return a flyweight of this object.
71  // If $string has an effect on the returned object (i.e. you
72  // need to overload this method), it is best
73  // to clone or instantiate new copies. (Instantiation is safer.)
74  return $this;
75  }
76 
81  protected function mungeRgb($string) {
82  return preg_replace('/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\)/', 'rgb(\1,\2,\3)', $string);
83  }
84 
85 }
86 
87 // vim: et sw=4 sts=4