mirror of
https://github.com/moodle/moodle.git
synced 2025-07-26 17:00:37 +02:00
Prior to this change, all the line endings in the imported HTMLPurifier library were using CRLF (\r\n aka Windows style), but the HTMLPurifier source and also the downloadable artefacts use LF (\n aka Linux style) as line endings. This has been the case since510d190382
when with the commit "MDL-38672 import HTML Purifier 4.5.0" all line endings were changed from LF to CRLF. There was no comment in the commit on why this change was done. As the original source uses LF, this commit partly reverts510d190382
and goes back to LF as line endings. Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
45 lines
872 B
PHP
45 lines
872 B
PHP
<?php
|
|
|
|
/**
|
|
* Dummy AttrDef that mimics another AttrDef, BUT it generates clones
|
|
* with make.
|
|
*/
|
|
class HTMLPurifier_AttrDef_Clone extends HTMLPurifier_AttrDef
|
|
{
|
|
/**
|
|
* What we're cloning.
|
|
* @type HTMLPurifier_AttrDef
|
|
*/
|
|
protected $clone;
|
|
|
|
/**
|
|
* @param HTMLPurifier_AttrDef $clone
|
|
*/
|
|
public function __construct($clone)
|
|
{
|
|
$this->clone = $clone;
|
|
}
|
|
|
|
/**
|
|
* @param string $v
|
|
* @param HTMLPurifier_Config $config
|
|
* @param HTMLPurifier_Context $context
|
|
* @return bool|string
|
|
*/
|
|
public function validate($v, $config, $context)
|
|
{
|
|
return $this->clone->validate($v, $config, $context);
|
|
}
|
|
|
|
/**
|
|
* @param string $string
|
|
* @return HTMLPurifier_AttrDef
|
|
*/
|
|
public function make($string)
|
|
{
|
|
return clone $this->clone;
|
|
}
|
|
}
|
|
|
|
// vim: et sw=4 sts=4
|