--- a/gt3-photo-video-gallery/core/actions/gt3pg_attachment_field_credit_save.php
+++ b/gt3-photo-video-gallery/core/actions/gt3pg_attachment_field_credit_save.php
@@ -5,10 +5,10 @@
function gt3pg_attachment_field_credit_save( $post, $attachment ) {
if ( isset( $attachment['gt3-video-url'] ) ) {
- update_post_meta( $post['ID'], 'gt3_video_url', $attachment['gt3-video-url'] );
+ update_post_meta( $post['ID'], 'gt3_video_url', esc_url_raw( $attachment['gt3-video-url'] ) );
}
if ( isset( $attachment['gt3-external-link-url'] ) ) {
- update_post_meta( $post['ID'], 'gt3_external_link_url', $attachment['gt3-external-link-url'] );
+ update_post_meta( $post['ID'], 'gt3_external_link_url', esc_url_raw( $attachment['gt3-external-link-url'] ) );
}
return $post;
--- a/gt3-photo-video-gallery/core/actions/gt3pg_wp_head.php
+++ b/gt3-photo-video-gallery/core/actions/gt3pg_wp_head.php
@@ -7,6 +7,8 @@
function gt3pg_wp_head() {
$settings = Settings::instance()->getSettings('basic');
if (is_array($settings) && key_exists('gt3pg_text_before_head', $settings) && !empty($settings['gt3pg_text_before_head'])) {
- echo "<style>" . $settings['gt3pg_text_before_head'] . "</style>n";
+ // Escape closing style tag to prevent XSS while preserving valid CSS
+ $css = str_replace( '</style', '</style', $settings['gt3pg_text_before_head'] );
+ echo "<style>" . $css . "</style>n";
}
}
--- a/gt3-photo-video-gallery/core/class-assets.php
+++ b/gt3-photo-video-gallery/core/class-assets.php
@@ -220,7 +220,7 @@
}
protected function elementor_recursive_style($data){
- if(in_array($data['elType'], array( 'section', 'column' ))) {
+ if(in_array($data['elType'], array( 'section', 'container', 'column' ))) {
foreach($data['elements'] as $modules) {
$this->elementor_recursive_style($modules);
}
@@ -313,7 +313,7 @@
foreach($block['innerBlocks'] as $chunk) {
$this->blocks_print_styles($chunk);
}
-
+
if(array_key_exists('blockName', $block) && is_string($block['blockName'])
&& strpos($block['blockName'], 'gt3pg') !== false) {
$module = str_replace('gt3pg-pro/', '', $block['blockName']);
@@ -345,9 +345,9 @@
filemtime(GT3PG_LITE_JS_PATH.'gutenberg/editor.js'),
true
);
-
+
$this->register_script__action();
-
+
$settings = Settings::instance();
wp_localize_script(
@@ -374,7 +374,7 @@
);
$this->frontend_gutenberg();
-
+
wp_enqueue_style('gt3pg-lite-frontend');
wp_enqueue_script('gt3pg-lite-frontend');
--- a/gt3-photo-video-gallery/core/cpt/gallery/init.php
+++ b/gt3-photo-video-gallery/core/cpt/gallery/init.php
@@ -779,12 +779,12 @@
}
public function manage_posts_custom_column($column, $post_id){
- $this_url = $_SERVER['REQUEST_URI'];
+ $this_url = esc_url_raw( $_SERVER['REQUEST_URI'] );
switch($column) {
case 'thumbnail':
if(get_post_thumbnail_id($post_id)) {
$img_src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id));
- echo '<img width="50" height="50" src="'.$img_src[0].'" />';
+ echo '<img width="50" height="50" src="'.esc_url($img_src[0]).'" />';
} else {
$gallery = self::get_gallery_images($post_id);
$echo = '';
@@ -798,7 +798,7 @@
}
$img_src = wp_get_attachment_image_src($image_id);
if (is_array($img_src)) {
- $echo = '<img width="50" height="50" src="'.$img_src[0].'" />';
+ $echo = '<img width="50" height="50" src="'.esc_url($img_src[0]).'" />';
}
if(!empty($echo)) {
break;
@@ -1162,7 +1162,7 @@
public function get_template($templates){
$object = get_queried_object();
- if($object->post_type === self::post_type) {
+ if ($object && isset($object->post_type) && $object->post_type === self::post_type) {
if(is_array($templates) && count($templates)) {
foreach($templates as &$template) {
$template = str_replace('single', 'page', $template);
@@ -1176,5 +1176,4 @@
}
GT3_Post_Type_Gallery::instance();
-}
-
+}
No newline at end of file
--- a/gt3-photo-video-gallery/core/deprecated/GT3_EDD_SL_Plugin_Updater.php
+++ b/gt3-photo-video-gallery/core/deprecated/GT3_EDD_SL_Plugin_Updater.php
@@ -491,7 +491,7 @@
return false; // Cache is expired
}
- return unserialize( $cache['value'] );
+ return maybe_unserialize( $cache['value'] );
}
--- a/gt3-photo-video-gallery/core/deprecated/gt3pg_updater.php
+++ b/gt3-photo-video-gallery/core/deprecated/gt3pg_updater.php
@@ -118,7 +118,7 @@
if ( isset( $_GET['sl_activation'] ) && ! empty( $_GET['sl_message'] ) ) {
switch ( $_GET['sl_activation'] ) {
case 'false':
- echo '<div class="error"><p>' . urldecode( $_GET['sl_message'] ) . '</p></div>';
+ echo '<div class="error"><p>' . esc_html(urldecode( $_GET['sl_message'] )) . '</p></div>';
break;
case 'true':
default:
@@ -197,7 +197,7 @@
}
$base_url = $this->get_menu_page();
if ( ! empty( $message ) ) {
- $redirect = add_query_arg( array( 'sl_activation' => 'false', 'sl_message' => urlencode( $message ) ), $base_url );
+ $redirect = add_query_arg( array( 'sl_activation' => 'false', 'sl_message' => esc_html(urlencode( $message )) ), esc_url($base_url) );
wp_redirect( $redirect );
exit();
}
--- a/gt3-photo-video-gallery/core/deprecated/notice.php
+++ b/gt3-photo-video-gallery/core/deprecated/notice.php
@@ -4,7 +4,7 @@
add_action('wp_ajax_gt3pg_disable_notice_pro_required_update', 'wp_ajax_gt3pg_disable_notice_pro_required_update');
function wp_ajax_gt3pg_disable_notice_pro_required_update(){
- if(!isset($_POST['gt3_action']) || !isset($_POST['_nonce']) || wp_verify_nonce($_POST['_nonce'],'disable_notice_pro_required_update')) {
+ if(!isset($_POST['gt3_action']) || !isset($_POST['_nonce']) || !wp_verify_nonce($_POST['_nonce'],'disable_notice_pro_required_update')) {
wp_die(0);
}
update_option('gt3pg_disable_notice_pro_required_update', true);
--- a/gt3-photo-video-gallery/gt3-photo-video-gallery.php
+++ b/gt3-photo-video-gallery/gt3-photo-video-gallery.php
@@ -4,7 +4,7 @@
** Plugin URI: https://gt3themes.com/
** Description: This powerful plugin lets you extend the functionality of the default WordPress gallery. You can easily customize the look and feel of the photo or video gallery.
** Discover the power of GT3themes products.
- ** Version: 2.7.7.26
+ ** Version: 2.7.7.27
** Author: GT3 Photo Gallery
** Author URI: https://gt3themes.com/
** Text Domain: gt3pg
--- a/gt3-photo-video-gallery/plugin.php
+++ b/gt3-photo-video-gallery/plugin.php
@@ -77,7 +77,7 @@
add_menu_page(
apply_filters('gt3pg_menu_page_title', 'GT3 Gallery Lite'),
apply_filters('gt3pg_menu_title', 'GT3 Gallery Lite'),
- 'administrator',
+ 'manage_options',
'gt3_photo_gallery_options',
'gt3pg_plugin_options',
Assets::get_dist_url().'img/logo.png',
--- a/gt3-photo-video-gallery/rate.php
+++ b/gt3-photo-video-gallery/rate.php
@@ -1,4 +1,7 @@
<?php
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
if (get_option('gt3pg_disable_rate_notice')) return;
$rate_time = get_option('gt3_rate_date');
if ($rate_time == false) {