Code Duplication    Length = 5-5 lines in 2 locations

htdocs/translate.php 1 location

@@ 592-596 (lines=5) @@
589
    $retval = [];
590
    if (is_dir($dir)) {
591
        if ($dh = opendir($dir)) {
592
            while (($file = readdir($dh)) !== false) {
593
                if (substr($file, - 4) == '.sql') {
594
                    $retval[] = substr($file, 0, strlen($file) - 4);
595
                }
596
            }
597
            closedir($dh);
598
        }
599
    }

htdocs/src/OcLegacy/Cache/WebCache.php 1 location

@@ 124-128 (lines=5) @@
121
    public function preCompileAllTemplates()
122
    {
123
        if ($hDir = opendir($this->opt['stylepath'])) {
124
            while (($sFilename = readdir($hDir)) !== false) {
125
                if (substr($sFilename, -4) === '.tpl') {
126
                    $this->preCompileTemplate(substr($sFilename, 0, strlen($sFilename) - 4));
127
                }
128
            }
129
            closedir($hDir);
130
        }
131