HTMLPurifier/HTMLModule/SafeObject.php Quellcode

SafeObject.php
gehe zur Dokumentation dieser Datei
1 <?php
2 
10 {
14  public $name = 'SafeObject';
15 
19  public function setup($config)
20  {
21  // These definitions are not intrinsically safe: the attribute transforms
22  // are a vital part of ensuring safety.
23 
24  $max = $config->get('HTML.MaxImgLength');
25  $object = $this->addElement(
26  'object',
27  'Inline',
28  'Optional: param | Flow | #PCDATA',
29  'Common',
30  array(
31  // While technically not required by the spec, we're forcing
32  // it to this value.
33  'type' => 'Enum#application/x-shockwave-flash',
34  'width' => 'Pixels#' . $max,
35  'height' => 'Pixels#' . $max,
36  'data' => 'URI#embedded',
37  'codebase' => new HTMLPurifier_AttrDef_Enum(
38  array(
39  'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'
40  )
41  ),
42  )
43  );
44  $object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject();
45 
46  $param = $this->addElement(
47  'param',
48  false,
49  'Empty',
50  false,
51  array(
52  'id' => 'ID',
53  'name*' => 'Text',
54  'value' => 'Text'
55  )
56  );
57  $param->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeParam();
58  $this->info_injector[] = 'SafeObject';
59  }
60 }
61 
62 // vim: et sw=4 sts=4




Korrekturen, Hinweise und Ergänzungen

Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.