Code Duplication    Length = 8-10 lines in 3 locations

main/document/edit_paint.php 2 locations

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

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

@@ 4565-4572 (lines=8) @@
4562
4563
        //make htaccess with allow from all, and file index.html into temp/audio
4564
        $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4565
        if (!file_exists($htaccess)) {
4566
            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4567
            $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4568
            if ($fp) {
4569
                fwrite($fp, $htaccess_content);
4570
                fclose($fp);
4571
            }
4572
        }
4573
4574
        //encript temp name file
4575
        $name_crip = sha1(uniqid());//encript