Code Duplication    Length = 8-8 lines in 2 locations

main/inc/lib/pear/HTML/QuickForm/advmultiselect.php 1 location

@@ 981-988 (lines=8) @@
978
            array_shift($labels);
979
        }
980
        // render extra labels, if any
981
        if (is_array($labels)) {
982
            foreach ($labels as $key => $text) {
983
                $key     = is_int($key)? $key + 2: $key;
984
                $strHtml = str_replace("{label_{$key}}", $text, $strHtml);
985
                $strHtml = str_replace("<!-- BEGIN label_{$key} -->", '', $strHtml);
986
                $strHtml = str_replace("<!-- END label_{$key} -->", '', $strHtml);
987
            }
988
        }
989
990
        // clean up useless label tags
991
        if (strpos($strHtml, '{label_')) {

main/inc/lib/pear/HTML/QuickForm/Renderer/Default.php 1 location

@@ 331-338 (lines=8) @@
328
            $html = str_replace('{error_class}', '', $html);
329
            $html = preg_replace("/([ \t\n\r]*)?<!-- BEGIN error -->.*<!-- END error -->([ \t\n\r]*)?/isU", '', $html);
330
        }
331
        if (is_array($label)) {
332
            foreach ($label as $key => $text) {
333
                $key  = is_int($key)? $key + 2: $key;
334
                $html = str_replace("{label_{$key}}", $text, $html);
335
                $html = str_replace("<!-- BEGIN label_{$key} -->", '', $html);
336
                $html = str_replace("<!-- END label_{$key} -->", '', $html);
337
            }
338
        }
339
        if (strpos($html, '{label_')) {
340
            $html = preg_replace('/\s*<!-- BEGIN label_(\S+) -->.*<!-- END label_\1 -->\s*/is', '', $html);
341
        }