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

  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 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 468Zeile 473
			else if(!$attachment['attachment_pid'] && $attachment['dateuploaded'] < TIME_NOW-60*60*24 && $attachment['dateuploaded'] != 0)
{
$incomplete_attachments[$attachment['aid']] = $attachment['aid'];

			else if(!$attachment['attachment_pid'] && $attachment['dateuploaded'] < TIME_NOW-60*60*24 && $attachment['dateuploaded'] != 0)
{
$incomplete_attachments[$attachment['aid']] = $attachment['aid'];

			}
}


			}
}


		// Now send the user to the final page
$form = new Form("index.php?module=forum-attachments&amp;action=orphans&amp;step=3", "post", "redirect_form", 0, "");
// Scan complete

		// Now send the user to the final page
$form = new Form("index.php?module=forum-attachments&amp;action=orphans&amp;step=3", "post", "redirect_form", 0, "");
// Scan complete

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 548Zeile 553
							while($attachment = $db->fetch_array($query))
{
unset($attachments_to_check[$attachment['attachname']]);

							while($attachment = $db->fetch_array($query))
{
unset($attachments_to_check[$attachment['attachname']]);

							}

							}


// Now anything left is bad!
if(count($attachments_to_check) > 0)


// Now anything left is bad!
if(count($attachments_to_check) > 0)

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>";

Zeile 703Zeile 708

$fid_in = array();
foreach($mybb->input['forum'] as $fid)


$fid_in = array();
foreach($mybb->input['forum'] as $fid)

			{

			{

				if(!$forum_cache[$fid])
{
$errors[] = $lang->error_invalid_forums;

				if(!$forum_cache[$fid])
{
$errors[] = $lang->error_invalid_forums;

Zeile 712Zeile 717
				$child_forums = get_child_list($fid);
$child_forums[] = $fid;
$fid_in = array_merge($fid_in, $child_forums);

				$child_forums = get_child_list($fid);
$child_forums[] = $fid;
$fid_in = array_merge($fid_in, $child_forums);

			}


			}


			if(count($fid_in) > 0)
{
$search_sql .= " AND p.fid IN (".implode(",", $fid_in).")";

			if(count($fid_in) > 0)
{
$search_sql .= " AND p.fid IN (".implode(",", $fid_in).")";

Zeile 732Zeile 737
			$direction_fields['dateuploaded'] = TIME_NOW-$direction_fields['dateuploaded']*60*60*24;
}
if($mybb->input['filesize'] && $mybb->request_method == "post")

			$direction_fields['dateuploaded'] = TIME_NOW-$direction_fields['dateuploaded']*60*60*24;
}
if($mybb->input['filesize'] && $mybb->request_method == "post")

		{

		{

			$direction_fields['filesize'] *= 1024;
}


			$direction_fields['filesize'] *= 1024;
}


Zeile 780Zeile 785
			if(!$mybb->input['perpage'])
{
$mybb->input['perpage'] = 20;

			if(!$mybb->input['perpage'])
{
$mybb->input['perpage'] = 20;

			}

			}


$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);
if($mybb->input['page'])


$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);
if($mybb->input['page'])

Zeile 800Zeile 805
					break;
case "downloads":
$sort_field = "a.downloads";

					break;
case "downloads":
$sort_field = "a.downloads";

					break;

					break;

				case "dateuploaded":
$sort_field = "a.dateuploaded";
break;

				case "dateuploaded":
$sort_field = "a.dateuploaded";
break;

Zeile 819Zeile 824

$page->add_breadcrumb_item($lang->results);
$page->output_header($lang->index_find_attachments);


$page->add_breadcrumb_item($lang->results);
$page->output_header($lang->index_find_attachments);





			$page->output_nav_tabs($sub_tabs, 'find_attachments');

$form = new Form("index.php?module=forum-attachments&amp;action=delete", "post");

			$page->output_nav_tabs($sub_tabs, 'find_attachments');

$form = new Form("index.php?module=forum-attachments&amp;action=delete", "post");

Zeile 853Zeile 858
			if($num_results > $mybb->input['perpage'])
{
$pagination_url = "index.php?module=forum-attachments&amp;results=1";

			if($num_results > $mybb->input['perpage'])
{
$pagination_url = "index.php?module=forum-attachments&amp;results=1";

				$pagination_vars = array('perpage', 'sortby', 'order', 'filename', 'mimetype', 'username', 'fid', 'downloads', 'downloads_dir', 'dateuploaded', 'dateuploaded_dir', 'filesize', 'filesize_dir');

				$pagination_vars = array('perpage', 'sortby', 'order', 'filename', 'mimetype', 'username', 'downloads', 'downloads_dir', 'dateuploaded', 'dateuploaded_dir', 'filesize', 'filesize_dir');

				foreach($pagination_vars as $var)
{
if($mybb->input[$var])
{
$pagination_url .= "&{$var}=".urlencode($mybb->input[$var]);

				foreach($pagination_vars as $var)
{
if($mybb->input[$var])
{
$pagination_url .= "&{$var}=".urlencode($mybb->input[$var]);

 
					}
}
if(is_array($mybb->input['forum']) && !empty($mybb->input['forum']))
{
foreach($mybb->input['forum'] as $fid)
{
$pagination_url .= "&forum[]=".(int)$fid;

					}
}
$pagination = draw_admin_pagination($mybb->input['page'], $mybb->input['perpage'], $num_results, $pagination_url);

					}
}
$pagination = draw_admin_pagination($mybb->input['page'], $mybb->input['perpage'], $num_results, $pagination_url);