Code Duplication    Length = 3-3 lines in 6 locations

include/install_function.php 3 locations

@@ 71-73 (lines=3) @@
68
    //        mkdir($dir, 0777);
69
    //    }
70
71
    if (!@mkdir($dir) && !is_dir($dir)) {
72
        throw new \RuntimeException('The directory ' . $dir . ' could not be created.');
73
    }
74
75
    chmod($dir, 0777);
76
@@ 78-80 (lines=3) @@
75
    chmod($dir, 0777);
76
77
    $dir = XOOPS_ROOT_PATH . '/uploads/news/file';
78
    if (!@mkdir($dir) && !is_dir($dir)) {
79
        throw new \RuntimeException('The directory ' . $dir . ' could not be created.');
80
    }
81
    chmod($dir, 0777);
82
83
    $dir = XOOPS_ROOT_PATH . '/uploads/news/image';
@@ 84-86 (lines=3) @@
81
    chmod($dir, 0777);
82
83
    $dir = XOOPS_ROOT_PATH . '/uploads/news/image';
84
    if (!@mkdir($dir) && !is_dir($dir)) {
85
        throw new \RuntimeException('The directory ' . $dir . ' could not be created.');
86
    }
87
    chmod($dir, 0777);
88
89
    // Copy index.html files on uploads folders

include/update_function.php 3 locations

@@ 155-157 (lines=3) @@
152
153
    // 6) Make files and folders
154
    $dir = XOOPS_ROOT_PATH . '/uploads/news';
155
    if (!@mkdir($dir) && !is_dir($dir)) {
156
        throw new \RuntimeException('The directory ' . $dir . ' could not be created.');
157
    }
158
    if (!is_writable($dir)) {
159
        chmod($dir, 0777);
160
    }
@@ 163-165 (lines=3) @@
160
    }
161
162
    $dir = XOOPS_ROOT_PATH . '/uploads/news/file';
163
    if (!@mkdir($dir) && !is_dir($dir)) {
164
        throw new \RuntimeException('The directory ' . $dir . ' could not be created.');
165
    }
166
    if (!is_writable($dir)) {
167
        chmod($dir, 0777);
168
    }
@@ 171-173 (lines=3) @@
168
    }
169
170
    $dir = XOOPS_ROOT_PATH . '/uploads/news/image';
171
    if (!@mkdir($dir) && !is_dir($dir)) {
172
        throw new \RuntimeException('The directory ' . $dir . ' could not be created.');
173
    }
174
    if (!is_writable($dir)) {
175
        chmod($dir, 0777);
176
    }