Vergleich admin/modules/forum/attachments.php - 1.8.15 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 229Zeile 229
	// Deleting specific attachments from uploads directory
if(is_array($mybb->input['orphaned_files']))
{

	// Deleting specific attachments from uploads directory
if(is_array($mybb->input['orphaned_files']))
{

		/**
* @param string $string
*
* @return string
*/
function clean_filename($string)
{
return str_replace(array(".."), "", $string);
}
$mybb->input['orphaned_files'] = array_map("clean_filename", $mybb->input['orphaned_files']);

 
		foreach($mybb->input['orphaned_files'] as $file)
{

		foreach($mybb->input['orphaned_files'] as $file)
{

 
			$file = str_replace('..', '', $file);
$path = MYBB_ROOT.$mybb->settings['uploadspath']."/".$file;
$real_path = realpath($path);

if($real_path === false || strpos(str_replace('\\', '/', $real_path), str_replace('\\', '/', realpath(MYBB_ROOT)).'/') !== 0 || $real_path == realpath(MYBB_ROOT.'install/lock'))
{
$error_count++;
continue;
}


			if(!@unlink(MYBB_ROOT.$mybb->settings['uploadspath']."/".$file))
{
$error_count++;

			if(!@unlink(MYBB_ROOT.$mybb->settings['uploadspath']."/".$file))
{
$error_count++;

Zeile 270Zeile 270
				remove_attachment($attachment['pid'], null, $attachment['aid']);
}
$success_count++;

				remove_attachment($attachment['pid'], null, $attachment['aid']);
}
$success_count++;

		}
}

$plugins->run_hooks("admin_forum_attachments_delete_orphans_commit");

		}
}

$plugins->run_hooks("admin_forum_attachments_delete_orphans_commit");


// Log admin action
log_admin_action();


// Log admin action
log_admin_action();





	$message = '';
$status = 'success';
if($error_count > 0)

	$message = '';
$status = 'success';
if($error_count > 0)

Zeile 287Zeile 287
	}

if($success_count > 0)

	}

if($success_count > 0)

	{

	{

		if($error_count > 0)
{
$message .= '<br />'.$lang->sprintf($lang->success_count, $success_count);

		if($error_count > 0)
{
$message .= '<br />'.$lang->sprintf($lang->success_count, $success_count);

Zeile 340Zeile 340
		}

if($mybb->input['incomplete_attachments'])

		}

if($mybb->input['incomplete_attachments'])

		{

		{

			$incomplete_attachments = my_unserialize($mybb->input['incomplete_attachments']);
$aids = array_merge($aids, $incomplete_attachments);
}

			$incomplete_attachments = my_unserialize($mybb->input['incomplete_attachments']);
$aids = array_merge($aids, $incomplete_attachments);
}

Zeile 374Zeile 374
			foreach($bad_attachments as $file)
{
$file_path = MYBB_ROOT.$mybb->settings['uploadspath']."/".$file;

			foreach($bad_attachments as $file)
{
$file_path = MYBB_ROOT.$mybb->settings['uploadspath']."/".$file;

				$filesize = get_friendly_size(filesize($file_path));
$table->construct_cell($form->generate_check_box('orphaned_files[]', $file, '', array('checked' => true)));
$table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));
$table->construct_cell("<span class=\"float_right\">{$filesize}</span>{$file}");
$table->construct_cell($lang->reason_not_in_table, array('class' => 'align_center'));
$table->construct_cell(my_date('relative', filemtime($file_path)), array('class' => 'align_center'));
$table->construct_row();







if(file_exists($file_path))
{
$filename = htmlspecialchars_uni($file);
$filesize = get_friendly_size(filesize($file_path));
$table->construct_cell($form->generate_check_box('orphaned_files[]', $file, '', array('checked' => true)));
$table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));
$table->construct_cell("<span class=\"float_right\">{$filesize}</span>{$filename}");
$table->construct_cell($lang->reason_not_in_table, array('class' => 'align_center'));
$table->construct_cell(my_date('relative', filemtime($file_path)), array('class' => 'align_center'));
$table->construct_row();
}

			}
}


			}
}


Zeile 497Zeile 502
		echo "<script type=\"text/javascript\">$(function() {
window.setTimeout(
function() {

		echo "<script type=\"text/javascript\">$(function() {
window.setTimeout(
function() {

						$(\"#redirect_form\").submit();

						$(\"#redirect_form\").trigger('submit');

					}, 100
);
});</script>";

					}, 100
);
});</script>";

Zeile 620Zeile 625
		echo "<script type=\"text/javascript\">$(function() {
window.setTimeout(
function() {

		echo "<script type=\"text/javascript\">$(function() {
window.setTimeout(
function() {

						$(\"#redirect_form\").submit();

						$(\"#redirect_form\").trigger('submit');

					}, 100
);
});</script>";

					}, 100
);
});</script>";