prepare() public method

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).
public prepare ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean | string
$config HTMLPurifier_Config
$context HTMLPurifier_Context
return boolean | string Boolean false if success, string of missing needed element/attribute if failure
 public function prepare($config, $context)
 {
     $this->sanitizer = new HTMLPurifier_AttrDef_URI();
     $this->config = $config;
     $this->context = $context;
     return parent::prepare($config, $context);
 }
 public function prepare($config, $context)
 {
     $this->attrValidator = new HTMLPurifier_AttrValidator();
     $this->config = $config;
     $this->context = $context;
     return parent::prepare($config, $context);
 }
 public function prepare($config, $context)
 {
     parent::prepare($config, $context);
     $this->config = $config;
     $this->context = $context;
     $this->removeNbsp = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp');
     $this->removeNbspExceptions = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions');
     $this->attrValidator = new HTMLPurifier_AttrValidator();
 }
Ejemplo n.º 4
0
 /**
  * @param HTMLPurifier_Config  $config  Configuration.
  * @param HTMLPurifier_Context $context Context.
  */
 public function prepare($config, $context)
 {
     parent::prepare($config, $context);
     $this->linkTextLength = $config->get('AutoFormat.LinkifyWithTextLengthLimit.Limit');
     $this->linkTextSuffix = $config->get('AutoFormat.LinkifyWithTextLengthLimit.Suffix');
     $this->linkTextRemoveProtocol = $config->get('AutoFormat.LinkifyWithTextLengthLimit.RemoveProtocol');
     if (!$this->linkTextLength) {
         $this->linkTextLength = null;
     }
 }
Ejemplo n.º 5
0
 /**
  * @param HTMLPurifier_Config $config
  * @param HTMLPurifier_Context $context
  * @return void
  */
 public function prepare($config, $context)
 {
     parent::prepare($config, $context);
     $this->config = $config;
     $this->context = $context;
     $this->removeNbsp = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp');
     $this->removeNbspExceptions = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions');
     $this->exclude = $config->get('AutoFormat.RemoveEmpty.Predicate');
     foreach ($this->exclude as $key => $attrs) {
         if (!is_array($attrs)) {
             // HACK, see HTMLPurifier/Printer/ConfigForm.php
             $this->exclude[$key] = explode(';', $attrs);
         }
     }
     $this->attrValidator = new HTMLPurifier_AttrValidator();
 }
Ejemplo n.º 6
0
 /**
  * @param HTMLPurifier_Config $config
  * @param HTMLPurifier_Context $context
  * @return void
  */
 public function prepare($config, $context)
 {
     parent::prepare($config, $context);
 }
Ejemplo n.º 7
0
 public function prepare($config, $context)
 {
     $this->docURL = $config->get('AutoFormat.PurifierLinkify.DocURL');
     return parent::prepare($config, $context);
 }
Ejemplo n.º 8
0
 function prepare($config, &$context)
 {
     $this->docURL = $config->get('AutoFormatParam', 'PurifierLinkifyDocURL');
     return parent::prepare($config, $context);
 }