Code Duplication    Length = 9-9 lines in 3 locations

class/gwikiPage.php 3 locations

@@ 2134-2142 (lines=9) @@
2131
                // close anything from $x to end in last
2132
                $close = strrev(substr($last, $x));
2133
                $y     = 0;
2134
                while (!empty($close[$y])) {
2135
                    if ($close[$y] === '*') {
2136
                        $list .= '</li></ul>';
2137
                    } //.($x>0?'</li>':'');
2138
                    if ($close[$y] === '#') {
2139
                        $list .= '</li></ol>';
2140
                    } //.($x>0?'</li>':'');
2141
                    ++$y;
2142
                }
2143
                // open anything from $x to end in
2144
                $open = substr($current, $x);
2145
                $y    = 0;
@@ 2146-2154 (lines=9) @@
2143
                // open anything from $x to end in
2144
                $open = substr($current, $x);
2145
                $y    = 0;
2146
                while (!empty($open[$y])) {
2147
                    if ($open[$y] === '*') {
2148
                        $list .= '<ul class="wikiulist">';
2149
                    }
2150
                    if ($open[$y] === '#') {
2151
                        $list .= '<ol class="wikiolist">';
2152
                    }
2153
                    ++$y;
2154
                }
2155
                $endli     = ($last === $current) ? '</li>' : '';
2156
                $last      = $current;
2157
                $lines[$i] = $list . $endli . "\n<li> " . substr($line, $p + 1);
@@ 2171-2179 (lines=9) @@
2168
        // close anything left open
2169
        $close = strrev($last);
2170
        $y     = 0;
2171
        while (!empty($close[$y])) {
2172
            if ($close[$y] === '*') {
2173
                $list .= "</li></ul>\n";
2174
            }
2175
            if ($close[$y] === '#') {
2176
                $list .= "</li></ol>\n";
2177
            }
2178
            ++$y;
2179
        }
2180
2181
        return $list;
2182
    }