mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-04 06:01:23 -04:00
Guard reparent/rearrange against bad values in source_id. Fixes #1843.
This commit is contained in:
@@ -81,6 +81,9 @@ class Organize_Controller extends Controller {
|
||||
|
||||
foreach (explode(",", $input->post("source_ids")) as $source_id) {
|
||||
$source = ORM::factory("item", $source_id);
|
||||
if (!$source->loaded()) {
|
||||
continue;
|
||||
}
|
||||
access::required("edit", $source->parent());
|
||||
|
||||
if ($source->contains($new_parent) || $source->id == $new_parent->id) {
|
||||
@@ -116,6 +119,11 @@ class Organize_Controller extends Controller {
|
||||
|
||||
$input = Input::instance();
|
||||
$target = ORM::factory("item", $input->post("target_id"));
|
||||
if (!$target->loaded()) {
|
||||
json::reply(null);
|
||||
return;
|
||||
}
|
||||
|
||||
$album = $target->parent();
|
||||
access::required("edit", $album);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user