diff --git a/acpcleanup/cleanup.php b/acpcleanup/cleanup.php index 9bba3518..9f062d70 100644 --- a/acpcleanup/cleanup.php +++ b/acpcleanup/cleanup.php @@ -226,7 +226,7 @@ public function delete_pegas($unwanted_pegas, $obsolete_pegas) ), ), - 'WHERE' => 'a.album_user_id <> ' . $this->album->get_public() . ' AND a.parent_id = 0', + 'WHERE' => 'a.album_user_id <> ' . (int) $this->album->get_public() . ' AND a.parent_id = 0', 'ORDER_BY' => 'a.album_id DESC', ); $sql = $this->db->sql_build_query('SELECT', $sql_array); diff --git a/acpimport/acp/main_module.php b/acpimport/acp/main_module.php index 8ed40442..0798646e 100644 --- a/acpimport/acp/main_module.php +++ b/acpimport/acp/main_module.php @@ -302,7 +302,7 @@ function import() $sql = 'SELECT username, user_colour, user_id FROM ' . USERS_TABLE . ' - WHERE user_id = ' . $user_id; + WHERE user_id = ' . (int) $user_id; $result = $db->sql_query($sql); $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -339,7 +339,7 @@ function import() // Where do we put them to? $sql = 'SELECT album_id, album_name FROM ' . $table_prefix . 'gallery_albums - WHERE album_id = ' . $album_id; + WHERE album_id = ' . (int) $album_id; $result = $db->sql_query($sql); $album_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); diff --git a/core/album/display.php b/core/album/display.php index e1875bd7..8fb9c556 100644 --- a/core/album/display.php +++ b/core/album/display.php @@ -137,7 +137,7 @@ public function generate_navigation($album_data) $album_parents = $this->get_parents($album_data); // Display username for personal albums - if ($album_data['album_user_id'] > \phpbbgallery\core\block::PUBLIC_ALBUM) + if ($album_data['album_user_id'] > (int) \phpbbgallery\core\block::PUBLIC_ALBUM) { $sql = 'SELECT user_id, username, user_colour FROM ' . USERS_TABLE . ' @@ -179,9 +179,9 @@ public function generate_navigation($album_data) 'ALBUM_ID' => $album_data['album_id'], 'ALBUM_NAME' => $album_data['album_name'], 'ALBUM_DESC' => generate_text_for_display($album_data['album_desc'], $album_data['album_desc_uid'], $album_data['album_desc_bitfield'], $album_data['album_desc_options']), - 'ALBUM_CONTEST_START' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', - 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', - 'ALBUM_CONTEST_END' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', + 'ALBUM_CONTEST_START' => ($album_data['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', + 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', + 'ALBUM_CONTEST_END' => ($album_data['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', 'U_VIEW_ALBUM' => $this->helper->route('phpbbgallery_core_album', array('album_id' => (int) $album_data['album_id'])), )); @@ -199,7 +199,8 @@ public function generate_navigation($album_data) */ public function get_parents($album_data) { - $album_parents = array(); + $album_parents = []; + if ($album_data['parent_id'] > 0) { if ($album_data['album_parents'] == '') @@ -210,11 +211,12 @@ public function get_parents($album_data) AND right_id > ' . (int) $album_data['right_id'] . ' AND album_user_id = ' . (int) $album_data['album_user_id'] . ' ORDER BY left_id ASC'; + $result = $this->db->sql_query($sql); while ($row = $this->db->sql_fetchrow($result)) { - $album_parents[$row['album_id']] = array($row['album_name'], (int) $row['album_type']); + $album_parents[$row['album_id']] = [$row['album_name'], (int) $row['album_type']]; } $this->db->sql_freeresult($result); @@ -344,8 +346,8 @@ public function display_albums($root_data = '', $display_moderators = true, $ret { $mark_read = 'all'; } - $root_data = array('album_id' => \phpbbgallery\core\block::PUBLIC_ALBUM); - $sql_where = 'a.album_user_id = ' . \phpbbgallery\core\block::PUBLIC_ALBUM; + $root_data = array('album_id' => (int) \phpbbgallery\core\block::PUBLIC_ALBUM); + $sql_where = 'a.album_user_id = ' . (int) \phpbbgallery\core\block::PUBLIC_ALBUM; } else if ($root_data == 'personal') { @@ -354,7 +356,7 @@ public function display_albums($root_data = '', $display_moderators = true, $ret $mark_read = 'all'; } $root_data = array('album_id' => 0); - $sql_where = 'a.album_user_id > ' . \phpbbgallery\core\block::PUBLIC_ALBUM; + $sql_where = 'a.album_user_id > ' . (int) \phpbbgallery\core\block::PUBLIC_ALBUM; $num_pegas = $this->config['phpbb_gallery_num_pegas']; $first_char = $this->request->variable('first_char', ''); if ($first_char == 'other') @@ -601,7 +603,7 @@ public function display_albums($root_data = '', $display_moderators = true, $ret foreach ($album_rows as $row) { // Empty category - if (($row['parent_id'] == $root_data['album_id']) && ($row['album_type'] == \phpbbgallery\core\block::TYPE_CAT)) + if (($row['parent_id'] == $root_data['album_id']) && ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT)) { $this->template->assign_block_vars('albumrow', array( 'S_IS_CAT' => true, @@ -676,7 +678,7 @@ public function display_albums($root_data = '', $display_moderators = true, $ret $folder_alt = ($album_unread) ? 'NEW_IMAGES' : 'NO_NEW_IMAGES'; $folder_image = ($album_unread) ? 'forum_unread' : 'forum_read'; } - if ($row['album_status'] == \phpbbgallery\core\block::ALBUM_LOCKED) + if ($row['album_status'] == (int) \phpbbgallery\core\block::ALBUM_LOCKED) { $folder_image = ($album_unread) ? 'forum_unread_locked' : 'forum_read_locked'; $folder_alt = 'ALBUM_LOCKED'; @@ -721,12 +723,12 @@ public function display_albums($root_data = '', $display_moderators = true, $ret $s_subalbums_list = (string) implode(', ', $s_subalbums_list); $catless = ($row['parent_id'] == $root_data['album_id']) ? true : false; - $s_username_hidden = ($lastimage_album_type == \phpbbgallery\core\block::TYPE_CONTEST) && $lastimage_contest_marked && !$this->gallery_auth->acl_check('m_status', $album_id, $row['album_user_id']) && ($this->user->data['user_id'] != $row['album_last_user_id'] || $row['album_last_user_id'] == ANONYMOUS); + $s_username_hidden = ($lastimage_album_type == (int) \phpbbgallery\core\block::TYPE_CONTEST) && $lastimage_contest_marked && !$this->gallery_auth->acl_check('m_status', $album_id, $row['album_user_id']) && ($this->user->data['user_id'] != $row['album_last_user_id'] || $row['album_last_user_id'] == ANONYMOUS); $this->template->assign_block_vars('albumrow', array( 'S_IS_CAT' => false, 'S_NO_CAT' => $catless && !$last_catless, - 'S_LOCKED_ALBUM' => ($row['album_status'] == \phpbbgallery\core\block::ALBUM_LOCKED) ? true : false, + 'S_LOCKED_ALBUM' => ($row['album_status'] == (int) \phpbbgallery\core\block::ALBUM_LOCKED) ? true : false, 'S_UNREAD_ALBUM' => ($album_unread) ? true : false, 'S_LIST_SUBALBUMS' => ($row['display_subalbum_list']) ? true : false, 'S_SUBALBUMS' => (sizeof($subalbums_list)) ? true : false, diff --git a/core/controller/index.php b/core/controller/index.php index 8dcb9623..4355bd24 100644 --- a/core/controller/index.php +++ b/core/controller/index.php @@ -225,7 +225,7 @@ public function base() 'S_RECENT_COMMENTS' => $this->helper->route('phpbbgallery_core_search_commented'), 'COMMENTS_EXPAND' => $this->gallery_config->get('rrc_gindex_comments') ? true : false, )); - $this->gallery_search->recent_comments($this->gallery_config->get('items_per_page'), 0); + $this->gallery_search->recent_comments($this->gallery_config->get('items_per_page'), 0, false); } } $this->display_legend(); diff --git a/core/controller/moderate.php b/core/controller/moderate.php index 7b94a4d2..f7c1b15b 100644 --- a/core/controller/moderate.php +++ b/core/controller/moderate.php @@ -3,7 +3,7 @@ /** * * @package phpBB Gallery Core -* @copyright (c) 2014 nickvergessen +* @copyright (c) 2014 nickvergessen | 2025 Leinad4Mind * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -425,56 +425,51 @@ public function album_overview($album_id, $page) { if (confirm_box(true) || $moving_target) { + $message = ''; switch ($action) { case 'approve': $this->image->approve_images($actions_array, $album_id); $this->album->update_info($album_id); - $message = $this->language->lang('WAITING_APPROVED_IMAGE', count($actions_array)); - $this->url->meta_refresh(3, $back_link); - trigger_error($message); break; + case 'unapprove': $this->image->unapprove_images($actions_array, $album_id); $this->album->update_info($album_id); - $message = $this->language->lang('WAITING_UNAPPROVED_IMAGE', count($actions_array)); - $this->url->meta_refresh(3, $back_link); - trigger_error($message); break; + case 'lock': $this->image->lock_images($actions_array, $album_id); $this->album->update_info($album_id); - $message = $this->language->lang('WAITING_LOCKED_IMAGE', count($actions_array)); - $this->url->meta_refresh(3, $back_link); - trigger_error($message); break; + case 'delete': $this->moderate->delete_images($actions_array); $this->album->update_info($album_id); - $message = $this->language->lang('DELETED_IMAGES', count($actions_array)); - $this->url->meta_refresh(3, $back_link); - trigger_error($message); break; + case 'move': $this->image->move_image($actions_array, $moving_target); $this->album->update_info($album_id); $this->album->update_info($moving_target); - $message = $this->language->lang('MOVED_IMAGES', count($actions_array)); - $this->url->meta_refresh(3, $back_link); - trigger_error($message); break; + case 'report': $this->report->close_reports_by_image($actions_array); $message = $this->language->lang('WAITING_REPORTED_DONE', count($actions_array)); - $this->url->meta_refresh(3, $back_link); - trigger_error($message); break; } + + if (!empty($message)) + { + $this->url->meta_refresh(3, $back_link); + trigger_error($message); + } } else { diff --git a/core/image/image.php b/core/image/image.php index 61cac549..31e34cfa 100644 --- a/core/image/image.php +++ b/core/image/image.php @@ -3,7 +3,7 @@ /** * * @package phpBB Gallery Core -* @copyright (c) 2014 nickvergessen +* @copyright (c) 2014 nickvergessen | Leinad4Mind 2025 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -613,50 +613,19 @@ public function get_last_image() return $row; } - public function assign_block($image_block_name, $image_data, $display_option = 0, $thumbanil_link = 'image_page', $imagename_link = 'image_page') + public function assign_block($image_block_name, $image_data, $display_option = 0, $thumbnail_link = 'image_page', $imagename_link = 'image_page') { // Now let's get display options - $show_ip = $show_ratings = $show_username = $show_views = $show_time = $show_imagename = $show_comments = $show_album = false; - if ($display_option >= self::IMAGE_SHOW_IP) - { - $show_ip = true; - $display_option = $display_option - self::IMAGE_SHOW_IP; - } - if ($display_option >= self::IMAGE_SHOW_RATINGS) - { - $show_ratings = true; - $display_option = $display_option - self::IMAGE_SHOW_RATINGS; - } - if ($display_option >= self::IMAGE_SHOW_USERNAME) - { - $show_username = true; - $display_option = $display_option - self::IMAGE_SHOW_USERNAME; - } - if ($display_option >= self::IMAGE_SHOW_VIEWS) - { - $show_views = true; - $display_option = $display_option - self::IMAGE_SHOW_VIEWS; - } - if ($display_option >= self::IMAGE_SHOW_TIME) - { - $show_time = true; - $display_option = $display_option - self::IMAGE_SHOW_TIME; - } - if ($display_option >= self::IMAGE_SHOW_IMAGENAME) - { - $show_imagename = true; - $display_option = $display_option - self::IMAGE_SHOW_IMAGENAME; - } - if ($display_option >= self::IMAGE_SHOW_COMMENTS) - { - $show_comments = true; - $display_option = $display_option - self::IMAGE_SHOW_COMMENTS; - } - if ($display_option == self::IMAGE_SHOW_ALBUM) - { - $show_album = true; - } - switch ($thumbanil_link) + $show_ip = ($display_option & self::IMAGE_SHOW_IP) !== 0; + $show_ratings = ($display_option & self::IMAGE_SHOW_RATINGS) !== 0; + $show_username = ($display_option & self::IMAGE_SHOW_USERNAME) !== 0; + $show_views = ($display_option & self::IMAGE_SHOW_VIEWS) !== 0; + $show_time = ($display_option & self::IMAGE_SHOW_TIME) !== 0; + $show_imagename = ($display_option & self::IMAGE_SHOW_IMAGENAME) !== 0; + $show_comments = ($display_option & self::IMAGE_SHOW_COMMENTS) !== 0; + $show_album = ($display_option & self::IMAGE_SHOW_ALBUM) !== 0; + + switch ($thumbnail_link) { case 'image_page': $action = $this->helper->route('phpbbgallery_core_image', array('image_id' => (int) $image_data['image_id'])); diff --git a/core/log.php b/core/log.php index 150244d6..feb63393 100644 --- a/core/log.php +++ b/core/log.php @@ -127,13 +127,13 @@ public function delete_logs($mark) * @param array $additional * @internal param int $start start count used to build paging */ - public function build_list($type, $limit = 0, $page = 1, $album = 0, $image = 0, $additional = array()) + public function build_list($type, $limit = 0, $page = 1, $album = 0, $image = 0, $additional = []) { if ($limit == 0) { $limit = $this->gallery_config->get('items_per_page'); } - $this->language->add_lang(array('info_acp_gallery_logs'), 'phpbbgallery/core'); + $this->language->add_lang(['info_acp_gallery_logs'], 'phpbbgallery/core'); $this->gallery_auth->load_user_permissions($this->user->data['user_id']); $sql_array = array( @@ -147,7 +147,7 @@ public function build_list($type, $limit = 0, $page = 1, $album = 0, $image = 0, ) ) ); - $sql_where = array(); + $sql_where = []; if ($type != 'all') { $sql_where[] = "l.log_type = '" . $this->db->sql_escape($type) . "'"; @@ -261,8 +261,7 @@ public function build_list($type, $limit = 0, $page = 1, $album = 0, $image = 0, 'U_LOG_IP' => $var['ip'], 'U_ALBUM_LINK' => $var['album'] != 0 ? $this->helper->route('phpbbgallery_core_album', array('album_id' => $var['album'])) : false, 'U_IMAGE_LINK' => $var['image'] != 0 ? $this->helper->route('phpbbgallery_core_image', array('image_id' => $var['image'])) : false, - //'U_LOG_ACTION' => $description, - 'U_LOG_ACTION' => $this->language->lang($var['description'][0], isset($var['description'][1]) ? $var['description'][1] : false, isset($var['description'][2]) ? $var['description'][2] : false, isset($var['description'][3]) ? $var['description'][3] : false), + 'U_LOG_ACTION' => isset($var['description']) && is_array($var['description']) ? $this->language->lang($var['description'][0], $var['description'][1] ?? false, $var['description'][2] ?? false, $var['description'][3] ?? false) : '', 'U_TIME' => $this->user->format_date($var['time']), )); } diff --git a/core/search.php b/core/search.php index db2fb5ef..678f16b6 100644 --- a/core/search.php +++ b/core/search.php @@ -209,6 +209,8 @@ public function random($limit, $user = 0, $fields = 'rrc_gindex_display', $block return; } + $id_ary = array_map('intval', $id_ary); + $sql_where = $this->db->sql_in_set('i.image_id', $id_ary); $sql_array = array( @@ -223,6 +225,7 @@ public function random($limit, $user = 0, $fields = 'rrc_gindex_display', $block ), 'WHERE' => 'i.image_status <> ' . \phpbbgallery\core\block::STATUS_ORPHAN . ' AND ' . $sql_where, + 'WHERE' => 'i.image_status <> ' . (int) \phpbbgallery\core\block::STATUS_ORPHAN . ' AND ' . $sql_where, 'GROUP_BY' => 'i.image_id, a.album_name, a.album_status, a.album_user_id, a.album_id', 'ORDER_BY' => $sql_order, ); @@ -250,10 +253,8 @@ public function recent_count() { $this->gallery_auth->load_user_permissions($this->user->data['user_id']); - $sql = 'SELECT COUNT(image_id) as count - FROM ' . $this->images_table . ' - WHERE image_status <> ' . \phpbbgallery\core\block::STATUS_ORPHAN; - $exclude_albums = array(); + $exclude_albums = []; + if (!$this->gallery_config->get('rrc_gindex_pegas')) { $sql_no_user = 'SELECT album_id FROM ' . $this->albums_table . ' WHERE album_user_id > 0'; @@ -264,20 +265,55 @@ public function recent_count() } $this->db->sql_freeresult($result); } + $exclude_albums = array_merge($exclude_albums, $this->gallery_auth->get_exclude_zebra()); - $sql .= ' AND ((' . $this->db->sql_in_set('image_album_id', array_diff($this->gallery_auth->acl_album_ids('i_view'), $exclude_albums), false, true) . ' AND image_status <> ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . ') - OR ' . $this->db->sql_in_set('image_album_id', array_diff($this->gallery_auth->acl_album_ids('m_status'), $exclude_albums), false, true) . ')'; + + // Get allowed album ids for view and mod permissions excluding excluded albums + $view_album_ids = array_diff($this->gallery_auth->acl_album_ids('i_view'), $exclude_albums); + $mod_album_ids = array_diff($this->gallery_auth->acl_album_ids('m_status'), $exclude_albums); + + if (empty($view_album_ids) && empty($mod_album_ids)) + { + return 0; + } + + $sql = 'SELECT COUNT(image_id) AS count + FROM ' . $this->images_table . ' + WHERE image_status <> ' . (int) \phpbbgallery\core\block::STATUS_ORPHAN; + + $conditions = []; + + if (!empty($view_album_ids)) + { + $conditions[] = '(' . $this->db->sql_in_set('image_album_id', $view_album_ids) . ' + AND image_status <> ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . ')'; + } + + if (!empty($mod_album_ids)) + { + $conditions[] = $this->db->sql_in_set('image_album_id', $mod_album_ids); + } + + if (!empty($conditions)) + { + $sql .= ' AND (' . implode(' OR ', $conditions) . ')'; + } + $result = $this->db->sql_query($sql); $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + return (int) $row['count']; } + + /** * recent comments - * @param (int) $limit How many imagese to query + * @param (int) $limit How many images to query * @param int $start */ - public function recent_comments($limit, $start = 0) + public function recent_comments($limit, $start = 0, $pagination = true) { $this->gallery_auth->load_user_permissions($this->user->data['user_id']); $sql_limit = $limit; @@ -302,7 +338,7 @@ public function recent_comments($limit, $start = 0) 'GROUP_BY' => 'c.comment_id, c.comment_time, i.image_id', 'ORDER_BY' => 'comment_time DESC' ); - $sql_array['WHERE'] .= ' AND ((' . $this->db->sql_in_set('image_album_id', array_diff($this->gallery_auth->acl_album_ids('i_view'), $exclude_albums), false, true) . ' AND image_status <> ' . \phpbbgallery\core\block::STATUS_UNAPPROVED . ') + $sql_array['WHERE'] .= ' AND ((' . $this->db->sql_in_set('image_album_id', array_diff($this->gallery_auth->acl_album_ids('i_view'), $exclude_albums), false, true) . ' AND image_status <> ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . ') OR ' . $this->db->sql_in_set('image_album_id', array_diff($this->gallery_auth->acl_album_ids('m_status'), $exclude_albums), false, true) . ')'; $sql_array['SELECT'] = 'COUNT(c.comment_id) as count'; @@ -361,17 +397,20 @@ public function recent_comments($limit, $start = 0) 'SEARCH_MATCHES' => $this->language->lang('TOTAL_COMMENTS_SPRINTF', $count), 'SEARCH_TITLE' => $this->language->lang('RECENT_COMMENTS'), )); - $this->pagination->generate_template_pagination(array( - 'routes' => array( - 'phpbbgallery_core_search_commented', - 'phpbbgallery_core_search_commented_page',), - 'params' => array()), 'pagination', 'page', $count, $limit, $start - ); + if ($pagination) + { + $this->pagination->generate_template_pagination(array( + 'routes' => array( + 'phpbbgallery_core_search_commented', + 'phpbbgallery_core_search_commented_page',), + 'params' => array()), 'pagination', 'page', $count, $limit, $start + ); + } } /** * Generate recent images and populate template - * @param (int) $limit How many imagese to query + * @param (int) $limit How many images to query * @param int $start * @param int $user * @param string $fields @@ -498,6 +537,8 @@ public function recent($limit, $start = 0, $user = 0, $fields = 'rrc_gindex_disp return; } + $id_ary = array_map('intval', $id_ary); + $sql_where = $this->db->sql_in_set('i.image_id', $id_ary); $sql_array = array( @@ -512,6 +553,7 @@ public function recent($limit, $start = 0, $user = 0, $fields = 'rrc_gindex_disp ), 'WHERE' => 'i.image_status <> ' . \phpbbgallery\core\block::STATUS_ORPHAN . ' AND ' . $sql_where, + 'WHERE' => 'i.image_status <> ' . (int) \phpbbgallery\core\block::STATUS_ORPHAN . ' AND ' . $sql_where, 'ORDER_BY' => $sql_order, ); $sql = $this->db->sql_build_query('SELECT', $sql_array); diff --git a/exif/event/exif_listener.php b/exif/event/exif_listener.php index fb2038e0..2f177bf2 100644 --- a/exif/event/exif_listener.php +++ b/exif/event/exif_listener.php @@ -212,10 +212,12 @@ public function user_get_default_values($event) public function ucp_set_settings_submit($event) { + global $request; + $additional_settings = $event['additional_settings']; if (!in_array('user_viewexif', $additional_settings)) { - $additional_settings['user_viewexif'] = request_var('viewexifs', false); + $additional_settings['user_viewexif'] = $request->variable('viewexifs', false); $event['additional_settings'] = $additional_settings; } } diff --git a/exif/exif.php b/exif/exif.php index 4058ddbb..86f9da7a 100644 --- a/exif/exif.php +++ b/exif/exif.php @@ -315,7 +315,7 @@ public function set_status() $update_data = ($this->status == self::DBSAVED) ? ", image_exif_data = '" . $db->sql_escape($this->serialized) . "'" : ''; $sql = 'UPDATE ' . $table_prefix . 'gallery_images SET image_has_exif = ' . $this->status . $update_data . ' - WHERE image_id = ' . $this->image_id; + WHERE image_id = ' . (int) $this->image_id; $db->sql_query($sql); }