Code Duplication    Length = 14-14 lines in 2 locations

include/module.php 1 location

@@ 152-165 (lines=14) @@
149
 *
150
 * @return bool
151
 */
152
function update_userlog_v116(XoopsModule $module)
153
{
154
    // remove old html template files
155
    $template_directory = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'n') . '/templates/';
156
    $template_list      = array_diff(scandir($template_directory, SCANDIR_SORT_NONE), ['..', '.']);
157
    foreach ($template_list as $k => $v) {
158
        $fileinfo = new SplFileInfo($template_directory . $v);
159
        if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) {
160
            @unlink($template_directory . $v);
161
        }
162
    }
163
164
    return true;
165
}
166

include/onupdate.php 1 location

@@ 141-154 (lines=14) @@
138
 *
139
 * @return bool
140
 */
141
function update_userlog_v116(XoopsModule $module)
142
{
143
    // remove old html template files
144
    $template_directory = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'n') . '/templates/';
145
    $template_list      = array_diff(scandir($template_directory, SCANDIR_SORT_NONE), ['..', '.']);
146
    foreach ($template_list as $k => $v) {
147
        $fileinfo = new SplFileInfo($template_directory . $v);
148
        if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) {
149
            @unlink($template_directory . $v);
150
        }
151
    }
152
153
    return true;
154
}
155