Code Duplication    Length = 13-14 lines in 2 locations

htdocs/xoops_lib/modules/protector/library/HTMLPurifier/HTMLDefinition.php 1 location

@@ 301-313 (lines=13) @@
298
            }
299
        }
300
301
        if (is_array($allowed_elements)) {
302
            foreach ($this->info as $name => $d) {
303
                if (!isset($allowed_elements[$name])) {
304
                    unset($this->info[$name]);
305
                }
306
                unset($allowed_elements[$name]);
307
            }
308
            // emit errors
309
            foreach ($allowed_elements as $element => $d) {
310
                $element = htmlspecialchars($element); // PHP doesn't escape errors, be careful!
311
                trigger_error("Element '$element' is not supported $support", E_USER_WARNING);
312
            }
313
        }
314
315
        // setup allowed attributes ---------------------------------------
316

htdocs/xoops_lib/modules/protector/library/HTMLPurifier/CSSDefinition.php 1 location

@@ 465-478 (lines=14) @@
462
        $support = "(for information on implementing this, see the " .
463
            "support forums) ";
464
        $allowed_properties = $config->get('CSS.AllowedProperties');
465
        if ($allowed_properties !== null) {
466
            foreach ($this->info as $name => $d) {
467
                if (!isset($allowed_properties[$name])) {
468
                    unset($this->info[$name]);
469
                }
470
                unset($allowed_properties[$name]);
471
            }
472
            // emit errors
473
            foreach ($allowed_properties as $name => $d) {
474
                // :TODO: Is this htmlspecialchars() call really necessary?
475
                $name = htmlspecialchars($name);
476
                trigger_error("Style attribute '$name' is not supported $support", E_USER_WARNING);
477
            }
478
        }
479
480
        $forbidden_properties = $config->get('CSS.ForbiddenProperties');
481
        if ($forbidden_properties !== null) {