Code Duplication    Length = 8-10 lines in 3 locations

main/document/edit_paint.php 2 locations

@@ 174-183 (lines=10) @@
171
172
//make htaccess with allow from all, and file index.html into temp/images
173
$htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
174
if (!file_exists($htaccess)) {
175
176
	$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
177
178
	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
179
	if ($fp) {
180
		fwrite($fp, $htaccess_content);
181
		fclose($fp);
182
	}
183
}
184
185
$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
186
if (!file_exists($html_index)) {
@@ 186-193 (lines=8) @@
183
}
184
185
$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
186
if (!file_exists($html_index)) {
187
	$html_index_content="<html><head></head><body></body></html>";
188
	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
189
	if ($fp) {
190
		fwrite($fp, $html_index_content);
191
		fclose($fp);
192
	}
193
}
194
195
//encript temp name file
196
$name_crip=sha1(uniqid());//encript

main/inc/lib/document.lib.php 1 location

@@ 4551-4558 (lines=8) @@
4548
4549
        //make htaccess with allow from all, and file index.html into temp/audio
4550
        $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4551
        if (!file_exists($htaccess)) {
4552
            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4553
            $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4554
            if ($fp) {
4555
                fwrite($fp, $htaccess_content);
4556
                fclose($fp);
4557
            }
4558
        }
4559
4560
        //encript temp name file
4561
        $name_crip = sha1(uniqid());//encript