mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit dc031b7b5f05089e02e5b526f800c2c2edbb8fcd
parent 3062034505f7040a32fabbbde7e2705ab72156a3
Author: markseu <mark2011@mayberg.se>
Date:   Mon, 10 Oct 2022 17:02:29 +0200

Updated core extension for Giovanni

Diffstat:
Msystem/extensions/core.php | 9+++++----
Msystem/extensions/update-current.ini | 4++--
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/system/extensions/core.php b/system/extensions/core.php @@ -2,7 +2,7 @@ // Core extension, https://github.com/annaesvensson/yellow-core class YellowCore { - const VERSION = "0.8.92"; + const VERSION = "0.8.93"; const RELEASE = "0.8.21"; public $page; // current page public $content; // content files @@ -2905,7 +2905,7 @@ class YellowToolbox { } // Return attributes from text - public function getTextAttributes($text) { + public function getTextAttributes($text, $attributesAllowEmptyString) { $tokens = array(); $posStart = $posQuote = 0; $textLength = strlenb($text); @@ -2941,7 +2941,7 @@ class YellowToolbox { } else { $key = $value = $tokens[$i]; } - if (!strempty($key) && !strempty($value)) { + if (!strempty($key) && (!strempty($value) || in_array(strtolower($key), $attributesAllowEmptyString))) { $attributes[$key] = $value; } } @@ -3478,6 +3478,7 @@ class YellowToolbox { "accept", "action", "align", "allow", "allowfullscreen", "alt", "autocomplete", "autoplay", "background", "bgcolor", "border", "cellpadding", "cellspacing", "charset", "checked", "cite", "class", "clear", "color", "cols", "colspan", "content", "contenteditable", "controls", "coords", "crossorigin", "datetime", "default", "dir", "disabled", "download", "enctype", "face", "for", "frameborder", "headers", "height", "hidden", "high", "href", "hreflang", "id", "integrity", "ismap", "label", "lang", "list", "loop", "low", "max", "maxlength", "media", "method", "min", "multiple", "muted", "name", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "poster", "prefix", "preload", "property", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "target", "title", "type", "usemap", "valign", "value", "width", "xmlns"); $attributesSvg = array( "accent-height", "accumulate", "additivive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "datenstrom", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "tabindex", "targetx", "targety", "transform", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xlink:href", "xml:id", "xml:space", "xmlns", "y", "y1", "y2", "z", "zoomandpan"); + $attributesAllowEmptyString = array("alt", "value"); $elementsSafe = $elementsHtml; $attributesSafe = $attributesHtml; if ($type=="svg") { @@ -3496,7 +3497,7 @@ class YellowToolbox { if (substrb($elementName, 0, 1)=="!") { $output .= "<$elementName$elementMiddle>"; } elseif (in_array(strtolower($elementName), $elementsSafe)) { - $elementAttributes = $this->getTextAttributes($elementMiddle); + $elementAttributes = $this->getTextAttributes($elementMiddle, $attributesAllowEmptyString); foreach ($elementAttributes as $key=>$value) { if (!in_array(strtolower($key), $attributesSafe) && !preg_match("/^(aria|data)-/i", $key)) { unset($elementAttributes[$key]); diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini @@ -11,11 +11,11 @@ Tag: feature system/extensions/command.php: command.php, create, update Extension: Core -Version: 0.8.92 +Version: 0.8.93 Description: Core functionality of the website. DocumentationUrl: https://github.com/annaesvensson/yellow-core DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/main/downloads/core.zip -Published: 2022-10-03 22:36:18 +Published: 2022-10-10 16:58:48 Developer: Mark Seuffert, David Fehrmann Tag: feature system/extensions/core.php: core.php, create, update