Changeset 3487270
- Timestamp:
- 03/20/2026 02:53:07 PM (2 weeks ago)
- Location:
- artplacer-widget/trunk
- Files:
-
- 3 edited
-
artplacer-widget.php (modified) (1 diff)
-
includes/functions.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
artplacer-widget/trunk/artplacer-widget.php
r3487263 r3487270 4 4 Plugin URI: https://wordpress.org/plugins/artplacer-widget/ 5 5 Description: Display the ArtPlacer widget into your products or posts. 6 Version: 2.23. 46 Version: 2.23.5 7 7 Author: ArtPlacer 8 8 Author URI: http://www.artplacer.com -
artplacer-widget/trunk/includes/functions.php
r3487263 r3487270 54 54 $attribute_name = preg_replace('/[^a-zA-Z0-9_\-:]/', '', (string) $attribute_name); 55 55 56 $forbidden_attributes = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover", "onmousemove", "onmouseout", "onkeydown", "onkeypress", "onkeyup", "onload", "onunload", "onbeforeunload", "onerror", "onabort", "onsubmit", "onreset", "onchange", "oninput", "onselect", "onfocus", "onblur", "onscroll", "onresize", "ondragstart", "ondrop", "ondragover", "onplay", "onpause", "onended", "onvolumechange", "onmessage", "onstorage", "onoffline", "ononline", "href", "src", "action", "formaction", "data", "poster", "background", "lowsrc", "dynsrc", "srcdoc", "style", "xlink:href", "content"]; 57 if ($attribute_name === '' || in_array($attribute_name, $forbidden_attributes)) return $string; 58 56 if ($attribute_name === '') return $string; 57 59 58 $value = function_exists('esc_attr') ? esc_attr($value) : htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8'); 60 59 if ($attribute_exists && $replace) { … … 82 81 } 83 82 83 function sanitizeHTML($string, $forbidden_attributes = array()) 84 { 85 if (empty($forbidden_attributes)) { 86 $forbidden_attributes = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover", "onmousemove", "onmouseout", "onkeydown", "onkeypress", "onkeyup", "onload", "onunload", "onbeforeunload", "onerror", "onabort", "onsubmit", "onreset", "onchange", "oninput", "onselect", "onfocus", "onblur", "onscroll", "onresize", "ondragstart", "ondrop", "ondragover", "onplay", "onpause", "onended", "onvolumechange", "onmessage", "onstorage", "onoffline", "ononline", "href", "src", "action", "formaction", "data", "poster", "background", "lowsrc", "dynsrc", "srcdoc", "style", "xlink:href", "content"]; 87 } 88 $forbidden_attributes = array_map('strtolower', $forbidden_attributes); 89 $string = preg_replace('/<(script|style)[^>]*>.*?<\/\\1>/si', '', $string); 90 foreach ($forbidden_attributes as $attr) { 91 $string = preg_replace('/\s+' . preg_quote($attr, '/') . '\s*=\s*(?:"[^"]*"|\'[^\']*\'|[^\s>]+)/i', '', $string); 92 $string = preg_replace('/\s+' . preg_quote($attr, '/') . '\b/i', '', $string); 93 } 94 return $string; 95 } 96 84 97 function getArtPlacerWidgetCode($code, $widget = NULL) 85 98 { 86 if (str_contains($code, '<script')) return; 87 $script = shortcodeToHTML($code); 99 $script = sanitizeHTML(shortcodeToHTML($code)); 88 100 $product = function_exists('wc_get_product') ? wc_get_product(get_the_ID()) : NULL; 89 101 -
artplacer-widget/trunk/readme.txt
r3487263 r3487270 138 138 = 2.23.2 = 139 139 * Prevents remote XSS vulnerability. 140 = 2.23. 4=140 = 2.23.5 = 141 141 * Prevents unlikely XSS vulnerability.
Note: See TracChangeset
for help on using the changeset viewer.