PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.20
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.20
1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 All 164 releases
← All changes | vendor_prefixed/masterminds/html5/src/HTML5/Serializer/OutputRules.php +2 -22 1.9.15 → 1.10.20 View file →
@@ -14,11 +14,8 @@
14 14 * Generate the output html5 based on element rules.
15 15 */
16 16 class OutputRules implements RulesInterface
17 17 {
18 - /**
19 - * Defined in http://www.w3.org/TR/html51/infrastructure.html#html-namespace-0.
20 - */
21 18 const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';
22 19 const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';
23 20 const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';
24 21 const NAMESPACE_XLINK = 'http://www.w3.org/1999/xlink';
@@ -32,14 +29,8 @@
32 29 protected $implicitNamespaces = array(self::NAMESPACE_HTML, self::NAMESPACE_SVG, self::NAMESPACE_MATHML, self::NAMESPACE_XML, self::NAMESPACE_XMLNS);
33 30 const IM_IN_HTML = 1;
34 31 const IM_IN_SVG = 2;
35 32 const IM_IN_MATHML = 3;
36 - /**
37 - * Used as cache to detect if is available ENT_HTML5.
38 - *
39 - * @var bool
40 - */
41 - private $hasHTML5 = \false;
42 33 protected $traverser;
43 34 protected $encode = \false;
44 35 protected $out;
45 36 protected $outputMode;
@@ -64,9 +55,8 @@
64 55 $this->encode = $options['encode_entities'];
65 56 }
66 57 $this->outputMode = static::IM_IN_HTML;
67 58 $this->out = $output;
68 - $this->hasHTML5 = \defined('ENT_HTML5');
69 59 }
70 60 public function addRule(array $rule)
71 61 {
72 62 $this->nonBooleanAttributes[] = $rule;
@@ -338,14 +328,10 @@
338 328 * @see http://www.w3.org/TR/2013/CR-html5-20130806/syntax.html#named-character-references True encoding will turn all named character references into their entities.
339 329 * This includes such characters as +.# and many other common ones. By default
340 330 * encoding here will just escape &'<>".
341 331 *
342 - * Note, PHP 5.4+ has better html5 encoding.
343 - *
344 - * @todo Use the Entities class in php 5.3 to have html5 entities.
345 - *
346 332 * @param string $text Text to encode.
347 - * @param bool $attribute True if we are encoding an attrubute, false otherwise.
333 + * @param bool $attribute True if we are encoding an attribute, false otherwise.
348 334 *
349 335 * @return string The encoded text.
350 336 */
351 337 protected function enc($text, $attribute = \false)
@@ -353,15 +339,9 @@
353 339 // Escape the text rather than convert to named character references.
354 340 if (!$this->encode) {
355 341 return $this->escape($text, $attribute);
356 342 }
357 - // If we are in PHP 5.4+ we can use the native html5 entity functionality to
358 - // convert the named character references.
359 - if ($this->hasHTML5) {
360 - return \htmlentities($text, \ENT_HTML5 | \ENT_SUBSTITUTE | \ENT_QUOTES, 'UTF-8', \false);
361 - } else {
362 - return \strtr($text, HTML5Entities::$map);
363 - }
343 + return \htmlentities($text, \ENT_HTML5 | \ENT_SUBSTITUTE | \ENT_QUOTES, 'UTF-8', \false);
364 344 }
365 345 /**
366 346 * Escape test.
367 347 *