Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/classified-listing/app/Controllers/Admin/NoticeController.php
+++ b/classified-listing/app/Controllers/Admin/NoticeController.php
@@ -192,7 +192,7 @@
.rtcl-review-notice h3 + p {
margin-top: 8px;
}
- .rtcl-review-button {
+ .rtcl-review-notice_actions .rtcl-review-button {
display: inline-block;
padding: 0.4375rem 0.75rem;
border: 0;
@@ -204,24 +204,24 @@
text-decoration: none;
white-space: nowrap;
}
- .rtcl-review-button:active {
+ .rtcl-review-notice_actions .rtcl-review-button:active {
background: var(--e-button-context-color-dark);
color: #fff;
text-decoration: none;
}
- .rtcl-review-button:focus {
+ .rtcl-review-notice_actions .rtcl-review-button:focus {
outline: 0;
background: var(--e-button-context-color-dark);
box-shadow: 0 0 0 2px var(--e-focus-color);
color: #fff;
text-decoration: none;
}
- .rtcl-review-button:hover {
+ .rtcl-review-notice_actions .rtcl-review-button:hover {
background: var(--e-button-context-color-dark);
color: #fff;
text-decoration: none;
}
- .rtcl-review-button.focus {
+ .rtcl-review-notice_actions .rtcl-review-button.focus {
outline: 0;
box-shadow: 0 0 0 2px var(--e-focus-color);
}
@@ -235,6 +235,7 @@
border: 1px solid;
background: 0 0;
color: var(--e-button-context-color);
+ text-decoration: none;
}
.rtcl-review-button.rtcl-review-button--outline:focus {
background: var(--e-button-context-tint);
--- a/classified-listing/app/Controllers/Admin/ScriptLoader.php
+++ b/classified-listing/app/Controllers/Admin/ScriptLoader.php
@@ -14,6 +14,7 @@
use RtclServicesFormBuilderFBHelper;
use RtclServicesFormBuilderLocalizedString;
use RtclServicesFormBuilderValidationRuleSettings;
+use WP_User;
/**
* Class ScriptLoader
@@ -652,6 +653,9 @@
}
}
}
+
+ $current_user = wp_get_current_user();
+
$localize = [
'plugin_url' => RTCL_URL,
'decimal_point' => $decimal_separator,
@@ -694,7 +698,9 @@
'is_enable_tax' => Functions::is_enable_tax(),
'payment_currency_symbol' => Functions::get_order_currency_symbol(),
'ai_enabled' => Functions::is_ai_enabled(),
- 'current_user' => wp_get_current_user(),
+ 'current_user' => [
+ 'roles' => $current_user instanceof WP_User ? $current_user->roles : [],
+ ],
'admin_url' => admin_url(),
'prompt_max_limit' => Functions::get_max_prompt_input_limit(),
'i18n' => [
@@ -897,7 +903,9 @@
$decimal_separator = Functions::get_decimal_separator();
$pricing_decimal_separator = Functions::get_decimal_separator( true );
- $localize = [
+ $current_user = wp_get_current_user();
+
+ $localize = [
'ajaxurl' => $this->ajaxurl,
'decimal_point' => $decimal_separator,
'pricing_decimal_point' => $pricing_decimal_separator,
@@ -924,7 +932,9 @@
'i18n_message' => esc_html__( 'Message', 'classified-listing' ),
'i18n_send' => esc_html__( 'Send', 'classified-listing' ),
'ai_enabled' => Functions::is_ai_enabled(),
- 'current_user' => wp_get_current_user(),
+ 'current_user' => [
+ 'roles' => $current_user instanceof WP_User ? $current_user->roles : [],
+ ],
'admin_url' => admin_url(),
'prompt_max_limit' => Functions::get_max_prompt_input_limit(),
];
--- a/classified-listing/app/Controllers/Ajax/FilterAjax.php
+++ b/classified-listing/app/Controllers/Ajax/FilterAjax.php
@@ -143,7 +143,7 @@
'id' => 'q',
'itemId' => 'search',
'label' => __( 'Keyword', 'classified-listing' ),
- 'selected' => [ $q => $q ],
+ 'selected' => [ esc_html( $q ) => esc_html( $q ) ],
];
if ( Functions::is_semantic_search_enabled() ) {
--- a/classified-listing/app/Controllers/Ajax/FormBuilderAjax.php
+++ b/classified-listing/app/Controllers/Ajax/FormBuilderAjax.php
@@ -604,6 +604,12 @@
$listingId = absint( Functions::request( "listingId" ) );
+ if ( ( ! $listingId || ! $listing = rtcl()->factory->get_listing( $listingId ) || ! Functions::current_user_can( 'edit_' . rtcl()->post_type, $listingId ) ) || ( ! is_user_logged_in() && ! Functions::is_enable_post_for_unregister() ) ) {
+ wp_send_json_error( __( 'You do not have sufficient permissions.', 'classified-listing' ) );
+
+ return;
+ }
+
if ( $attach->post_parent !== $listingId ) {
wp_send_json_error( __( "Incorrect attachment ID.", "classified-listing" ) );
--- a/classified-listing/app/Controllers/Ajax/PublicUser.php
+++ b/classified-listing/app/Controllers/Ajax/PublicUser.php
@@ -1236,44 +1236,46 @@
$post_id = $success = wp_insert_post( apply_filters( 'rtcl_listing_save_update_args', $post_arg, $type ) );
}
- if ( $post_id && isset( $_POST['rtcl_listing_tag'] ) ) {
- $tags = Functions::sanitize( $_POST['rtcl_listing_tag'] );
- $tags_as_array = ! empty( $tags ) ? explode( ',', $tags ) : [];
- wp_set_object_terms( $post_id, $tags_as_array, rtcl()->tag );
- }
-
- if ( $type == 'new' && $post_id ) {
- wp_set_object_terms( $post_id, $cats, rtcl()->category );
- $meta['ad_type'] = $listing_type;
- }
- if ( 'local' === Functions::location_type() ) {
- $locations = [];
- if ( $loc = Functions::request( 'location' ) ) {
- $locations[] = absint( $loc );
+ if ( $success && $post_id ) {
+ if ( isset( $_POST['rtcl_listing_tag'] ) ) {
+ $tags = Functions::sanitize( $_POST['rtcl_listing_tag'] );
+ $tags_as_array = ! empty( $tags ) ? explode( ',', $tags ) : [];
+ wp_set_object_terms( $post_id, $tags_as_array, rtcl()->tag );
}
- if ( $loc = Functions::request( 'sub_location' ) ) {
- $locations[] = absint( $loc );
+
+ if ( $type == 'new' ) {
+ wp_set_object_terms( $post_id, $cats, rtcl()->category );
+ $meta['ad_type'] = $listing_type;
}
- if ( $loc = Functions::request( 'sub_sub_location' ) ) {
- $locations[] = absint( $loc );
+ if ( 'local' === Functions::location_type() ) {
+ $locations = [];
+ if ( $loc = Functions::request( 'location' ) ) {
+ $locations[] = absint( $loc );
+ }
+ if ( $loc = Functions::request( 'sub_location' ) ) {
+ $locations[] = absint( $loc );
+ }
+ if ( $loc = Functions::request( 'sub_sub_location' ) ) {
+ $locations[] = absint( $loc );
+ }
+ wp_set_object_terms( $post_id, $locations, rtcl()->location );
}
- wp_set_object_terms( $post_id, $locations, rtcl()->location );
- }
- // Custom Meta field
- if ( isset( $_POST['rtcl_fields'] ) && $post_id ) {
- foreach ( $_POST['rtcl_fields'] as $key => $value ) {
- $field_id = (int) str_replace( '_field_', '', $key );
- if ( $field = rtcl()->factory->get_custom_field( $field_id ) ) {
- $field->saveSanitizedValue( $post_id, $value );
+ // Custom Meta field
+ if ( isset( $_POST['rtcl_fields'] ) ) {
+ foreach ( $_POST['rtcl_fields'] as $key => $value ) {
+ $field_id = (int) str_replace( '_field_', '', $key );
+ if ( $field = rtcl()->factory->get_custom_field( $field_id ) ) {
+ $field->saveSanitizedValue( $post_id, $value );
+ }
}
}
- }
- /* meta data */
- if ( ! empty( $meta ) && $post_id ) {
- foreach ( $meta as $key => $value ) {
- update_post_meta( $post_id, $key, $value );
+ /* meta data */
+ if ( ! empty( $meta ) ) {
+ foreach ( $meta as $key => $value ) {
+ update_post_meta( $post_id, $key, $value );
+ }
}
}
--- a/classified-listing/assets/block/main.asset.php
+++ b/classified-listing/assets/block/main.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('jquery', 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'e7fbab2a01da1d784f59');
+<?php return array('dependencies' => array('jquery', 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'a7660fa4b00fa53e9866');
--- a/classified-listing/classified-listing.php
+++ b/classified-listing/classified-listing.php
@@ -1,10 +1,10 @@
<?php
/**
* @package CalssifiedListing
- * Plugin Name: Classified Listing – AI-Powered Classified ads & Business Directory Plugin
+ * Plugin Name: Classified Listing – AI-Powered Classified ads & Business Directory
* Plugin URI: https://radiustheme.com/demo/wordpress/classified
* Description: The Best Classified Listing and Business Directory Plugin for WordPress to create Classified ads website, job directory, local business directory and service directory.
- * Version: 5.4.2
+ * Version: 5.4.3
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: Business Directory Team by RadiusTheme
@@ -18,7 +18,7 @@
defined( 'ABSPATH' ) || die( 'Keep Silent' );
-define( 'RTCL_VERSION', '5.4.2' );
+define( 'RTCL_VERSION', '5.4.3' );
define( 'RTCL_PLUGIN_FILE', __FILE__ );
define( 'RTCL_PATH', plugin_dir_path( RTCL_PLUGIN_FILE ) );
define( 'RTCL_URL', plugins_url( '', RTCL_PLUGIN_FILE ) );