mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-58635 blogs: check edited blog belongs to current user
This commit is contained in:
parent
dca8394630
commit
b7fcd09582
2 changed files with 6 additions and 5 deletions
|
@ -52,11 +52,11 @@ $action = (empty($id)) ? 'add' : 'edit';
|
|||
|
||||
$external = new stdClass();
|
||||
|
||||
// Check that this id exists.
|
||||
if (!empty($id) && !$DB->record_exists('blog_external', array('id' => $id))) {
|
||||
print_error('wrongexternalid', 'blog');
|
||||
} else if (!empty($id)) {
|
||||
$external = $DB->get_record('blog_external', array('id' => $id));
|
||||
// Retrieve the external blog record.
|
||||
if (!empty($id)) {
|
||||
if (!$external = $DB->get_record('blog_external', array('id' => $id, 'userid' => $USER->id))) {
|
||||
print_error('wrongexternalid', 'blog');
|
||||
}
|
||||
$external->autotags = core_tag_tag::get_item_tags_array('core', 'blog_external', $id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue