Changeset 2996581
- Timestamp:
- 11/15/2023 04:57:08 PM (2 years ago)
- Location:
- soliloquy-lite
- Files:
-
- 8 edited
- 1 copied
-
tags/2.7.4.1 (copied) (copied from soliloquy-lite/trunk)
-
tags/2.7.4.1/includes/admin/ajax.php (modified) (19 diffs)
-
tags/2.7.4.1/includes/admin/common.php (modified) (1 diff)
-
tags/2.7.4.1/readme.txt (modified) (2 diffs)
-
tags/2.7.4.1/soliloquy-lite.php (modified) (2 diffs)
-
trunk/includes/admin/ajax.php (modified) (19 diffs)
-
trunk/includes/admin/common.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/soliloquy-lite.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
soliloquy-lite/tags/2.7.4.1/includes/admin/ajax.php
r2993325 r2996581 80 80 check_admin_referer( 'soliloquy-save-meta', 'nonce' ); 81 81 82 if ( ! current_user_can( 'edit_posts' ) ) { 83 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 84 } 85 82 86 // Get required inputs. 83 87 $attachment_id = isset( $_POST['attachment_id'] ) ? absint( wp_unslash( $_POST['attachment_id'] ) ) : false; … … 103 107 // Run a security check first. 104 108 check_ajax_referer( 'soliloquy-upgrade', 'nonce' ); 109 110 if ( ! current_user_can( 'edit_posts' ) ) { 111 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 112 } 105 113 106 114 // Increase the time limit to account for large slider sets and suspend cache invalidations. … … 232 240 check_ajax_referer( 'soliloquy-is-hosted', 'nonce' ); 233 241 242 if ( ! current_user_can( 'edit_posts' ) ) { 243 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 244 } 245 234 246 // Setup vars. 235 247 $video_url = ( isset( $_POST['video_url'] ) ? sanitize_text_field( wp_unslash( $_POST['video_url'] ) ) : '' ); … … 280 292 check_ajax_referer( 'soliloquy-change-type', 'nonce' ); 281 293 294 if ( ! current_user_can( 'edit_posts' ) ) { 295 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 296 } 297 282 298 // Prepare variables. 283 299 $post_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : ''; … … 308 324 public function load_image() { 309 325 310 if ( ! current_user_can( 'upload_files' ) ) {311 die();312 }313 314 326 // Run a security check first. 315 327 check_ajax_referer( 'soliloquy-load-image', 'nonce' ); 328 329 if ( ! current_user_can( 'edit_posts' ) ) { 330 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 331 } 316 332 317 333 // Prepare variables. … … 372 388 public function insert_slides() { 373 389 374 if ( ! current_user_can( 'upload_files' ) ) {375 die();376 }377 390 // Run a security check first. 378 391 check_ajax_referer( 'soliloquy-insert-images', 'nonce' ); 392 393 if ( ! current_user_can( 'edit_posts' ) ) { 394 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 395 } 379 396 380 397 // Prepare variables. … … 481 498 check_ajax_referer( 'soliloquy-sort', 'nonce' ); 482 499 500 if ( ! current_user_can( 'edit_posts' ) ) { 501 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 502 } 503 483 504 // Prepare variables. 484 505 $order = isset( $_POST['order'] ) ? explode( ',', wp_unslash( $_POST['order'] ) ) : array(); //@codingStandardsIgnoreLine … … 515 536 // Run a security check first. 516 537 check_ajax_referer( 'soliloquy-remove-slide', 'nonce' ); 538 539 if ( ! current_user_can( 'edit_posts' ) ) { 540 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 541 } 517 542 518 543 // Prepare variables. … … 567 592 // Run a security check first. 568 593 check_ajax_referer( 'soliloquy-remove-slide', 'nonce' ); 594 595 if ( ! current_user_can( 'edit_posts' ) ) { 596 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 597 } 569 598 570 599 // Prepare variables. … … 613 642 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 614 643 644 if ( ! current_user_can( 'edit_posts' ) ) { 645 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 646 } 647 615 648 // Prepare variables. 616 649 $post_id = isset( $_POST['post_id'] ) ? absint( wp_unslash( $_POST['post_id'] ) ) : false; … … 683 716 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 684 717 718 if ( ! current_user_can( 'edit_posts' ) ) { 719 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 720 } 721 685 722 // Prepare variables. 686 723 $post_id = isset( $_POST['post_id'] ) ? absint( wp_unslash( $_POST['post_id'] ) ) : false; … … 759 796 // Run a security check first. 760 797 check_ajax_referer( 'soliloquy-refresh', 'nonce' ); 798 799 if ( ! current_user_can( 'edit_posts' ) ) { 800 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 801 } 761 802 762 803 // Prepare variables. … … 946 987 // Run a security check first. 947 988 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 989 990 if ( ! current_user_can( 'edit_posts' ) ) { 991 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 992 } 993 948 994 $post_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : false; 949 995 $view = isset( $_POST['view'] ) ? trim( sanitize_text_field( wp_unslash( $_POST['view'] ) ) ) : false; … … 981 1027 // Run a security check first. 982 1028 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 1029 1030 if ( ! current_user_can( 'edit_posts' ) ) { 1031 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 1032 } 983 1033 984 1034 // Prepare variables. … … 1075 1125 check_admin_referer( 'soliloquy-activate-partner', 'nonce' ); 1076 1126 1127 if ( ! current_user_can( 'activate_plugins' ) ) { 1128 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to deactivate plugins.', 'soliloquy' ) ] ); 1129 } 1130 1077 1131 // Activate the addon. 1078 1132 if ( isset( $_POST['basename'] ) ) { … … 1099 1153 check_admin_referer( 'soliloquy-deactivate-partner', 'nonce' ); 1100 1154 1155 if ( ! current_user_can( 'activate_plugins' ) ) { 1156 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to deactivate plugins.', 'soliloquy' ) ] ); 1157 } 1158 1101 1159 // Deactivate the addon. 1102 1160 if ( isset( $_POST['basename'] ) ) { … … 1117 1175 check_admin_referer( 'soliloquy-install-partner', 'nonce' ); 1118 1176 1177 if ( ! current_user_can( 'install_plugins' ) ) { 1178 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to install plugins.', 'soliloquy' ) ] ); 1179 } 1180 1119 1181 // Install the addon. 1120 1182 if ( isset( $_POST['download_url'] ) ) { … … 1125 1187 // Set the current screen to avoid undefined notices. 1126 1188 set_current_screen(); 1189 1190 $method = ''; 1191 $url = esc_url( admin_url( 'edit.php?post_type=soliloquy&page=soliloquy-lite-about-us' ) ); 1127 1192 1128 1193 // Start output bufferring to catch the filesystem form if credentials are needed. … … 1239 1304 // Start output bufferring to catch the filesystem form if credentials are needed. 1240 1305 ob_start(); 1306 1307 $method = ''; 1308 $url = esc_url_raw( admin_url( 'edit.php?post_type=soliloquy&page=soliloquy-lite-about-us' ) ); 1309 1241 1310 $creds = request_filesystem_credentials( $url, $method, false, false, null ); 1242 1311 if ( false === $creds ) { -
soliloquy-lite/tags/2.7.4.1/includes/admin/common.php
r2993325 r2996581 198 198 esc_url( $this->get_upgrade_link( 'http://soliloquywp.com/lite/', 'adminsidebar', 'unlockprosidebar' ) ) 199 199 ); 200 201 if ( ! current_user_can( 'manage_options' ) ) { 202 return; 203 } 200 204 201 205 $upgrade_link_position = key( -
soliloquy-lite/tags/2.7.4.1/readme.txt
r2993325 r2996581 5 5 Tested up to: 6.4.1 6 6 Requires PHP: 5.6 7 Stable tag: 2.7.4 7 Stable tag: 2.7.4.1 8 8 License: GNU General Public License v2.0 or later 9 9 … … 259 259 260 260 == Changelog == 261 = 2.7.4.1 = 262 * Fixed: Notices for non-admin users in admin. 263 * Fixed: Capability checks for ajax calls 261 264 262 265 = 2.7.4 = -
soliloquy-lite/tags/2.7.4.1/soliloquy-lite.php
r2993325 r2996581 6 6 * Author: Soliloquy Team 7 7 * Author URI: https://soliloquywp.com 8 * Version: 2.7.4 8 * Version: 2.7.4.1 9 9 * Text Domain: soliloquy 10 10 * Domain Path: languages … … 57 57 * @var string 58 58 */ 59 public $version = '2.7.4 ';59 public $version = '2.7.4.1'; 60 60 61 61 /** -
soliloquy-lite/trunk/includes/admin/ajax.php
r2993325 r2996581 80 80 check_admin_referer( 'soliloquy-save-meta', 'nonce' ); 81 81 82 if ( ! current_user_can( 'edit_posts' ) ) { 83 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 84 } 85 82 86 // Get required inputs. 83 87 $attachment_id = isset( $_POST['attachment_id'] ) ? absint( wp_unslash( $_POST['attachment_id'] ) ) : false; … … 103 107 // Run a security check first. 104 108 check_ajax_referer( 'soliloquy-upgrade', 'nonce' ); 109 110 if ( ! current_user_can( 'edit_posts' ) ) { 111 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 112 } 105 113 106 114 // Increase the time limit to account for large slider sets and suspend cache invalidations. … … 232 240 check_ajax_referer( 'soliloquy-is-hosted', 'nonce' ); 233 241 242 if ( ! current_user_can( 'edit_posts' ) ) { 243 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 244 } 245 234 246 // Setup vars. 235 247 $video_url = ( isset( $_POST['video_url'] ) ? sanitize_text_field( wp_unslash( $_POST['video_url'] ) ) : '' ); … … 280 292 check_ajax_referer( 'soliloquy-change-type', 'nonce' ); 281 293 294 if ( ! current_user_can( 'edit_posts' ) ) { 295 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 296 } 297 282 298 // Prepare variables. 283 299 $post_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : ''; … … 308 324 public function load_image() { 309 325 310 if ( ! current_user_can( 'upload_files' ) ) {311 die();312 }313 314 326 // Run a security check first. 315 327 check_ajax_referer( 'soliloquy-load-image', 'nonce' ); 328 329 if ( ! current_user_can( 'edit_posts' ) ) { 330 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 331 } 316 332 317 333 // Prepare variables. … … 372 388 public function insert_slides() { 373 389 374 if ( ! current_user_can( 'upload_files' ) ) {375 die();376 }377 390 // Run a security check first. 378 391 check_ajax_referer( 'soliloquy-insert-images', 'nonce' ); 392 393 if ( ! current_user_can( 'edit_posts' ) ) { 394 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 395 } 379 396 380 397 // Prepare variables. … … 481 498 check_ajax_referer( 'soliloquy-sort', 'nonce' ); 482 499 500 if ( ! current_user_can( 'edit_posts' ) ) { 501 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 502 } 503 483 504 // Prepare variables. 484 505 $order = isset( $_POST['order'] ) ? explode( ',', wp_unslash( $_POST['order'] ) ) : array(); //@codingStandardsIgnoreLine … … 515 536 // Run a security check first. 516 537 check_ajax_referer( 'soliloquy-remove-slide', 'nonce' ); 538 539 if ( ! current_user_can( 'edit_posts' ) ) { 540 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 541 } 517 542 518 543 // Prepare variables. … … 567 592 // Run a security check first. 568 593 check_ajax_referer( 'soliloquy-remove-slide', 'nonce' ); 594 595 if ( ! current_user_can( 'edit_posts' ) ) { 596 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 597 } 569 598 570 599 // Prepare variables. … … 613 642 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 614 643 644 if ( ! current_user_can( 'edit_posts' ) ) { 645 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 646 } 647 615 648 // Prepare variables. 616 649 $post_id = isset( $_POST['post_id'] ) ? absint( wp_unslash( $_POST['post_id'] ) ) : false; … … 683 716 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 684 717 718 if ( ! current_user_can( 'edit_posts' ) ) { 719 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 720 } 721 685 722 // Prepare variables. 686 723 $post_id = isset( $_POST['post_id'] ) ? absint( wp_unslash( $_POST['post_id'] ) ) : false; … … 759 796 // Run a security check first. 760 797 check_ajax_referer( 'soliloquy-refresh', 'nonce' ); 798 799 if ( ! current_user_can( 'edit_posts' ) ) { 800 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 801 } 761 802 762 803 // Prepare variables. … … 946 987 // Run a security check first. 947 988 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 989 990 if ( ! current_user_can( 'edit_posts' ) ) { 991 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 992 } 993 948 994 $post_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : false; 949 995 $view = isset( $_POST['view'] ) ? trim( sanitize_text_field( wp_unslash( $_POST['view'] ) ) ) : false; … … 981 1027 // Run a security check first. 982 1028 check_ajax_referer( 'soliloquy-save-meta', 'nonce' ); 1029 1030 if ( ! current_user_can( 'edit_posts' ) ) { 1031 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to edit sliders.', 'soliloquy' ) ] ); 1032 } 983 1033 984 1034 // Prepare variables. … … 1075 1125 check_admin_referer( 'soliloquy-activate-partner', 'nonce' ); 1076 1126 1127 if ( ! current_user_can( 'activate_plugins' ) ) { 1128 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to deactivate plugins.', 'soliloquy' ) ] ); 1129 } 1130 1077 1131 // Activate the addon. 1078 1132 if ( isset( $_POST['basename'] ) ) { … … 1099 1153 check_admin_referer( 'soliloquy-deactivate-partner', 'nonce' ); 1100 1154 1155 if ( ! current_user_can( 'activate_plugins' ) ) { 1156 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to deactivate plugins.', 'soliloquy' ) ] ); 1157 } 1158 1101 1159 // Deactivate the addon. 1102 1160 if ( isset( $_POST['basename'] ) ) { … … 1117 1175 check_admin_referer( 'soliloquy-install-partner', 'nonce' ); 1118 1176 1177 if ( ! current_user_can( 'install_plugins' ) ) { 1178 wp_send_json_error( [ 'message' => esc_html__( 'You are not allowed to install plugins.', 'soliloquy' ) ] ); 1179 } 1180 1119 1181 // Install the addon. 1120 1182 if ( isset( $_POST['download_url'] ) ) { … … 1125 1187 // Set the current screen to avoid undefined notices. 1126 1188 set_current_screen(); 1189 1190 $method = ''; 1191 $url = esc_url( admin_url( 'edit.php?post_type=soliloquy&page=soliloquy-lite-about-us' ) ); 1127 1192 1128 1193 // Start output bufferring to catch the filesystem form if credentials are needed. … … 1239 1304 // Start output bufferring to catch the filesystem form if credentials are needed. 1240 1305 ob_start(); 1306 1307 $method = ''; 1308 $url = esc_url_raw( admin_url( 'edit.php?post_type=soliloquy&page=soliloquy-lite-about-us' ) ); 1309 1241 1310 $creds = request_filesystem_credentials( $url, $method, false, false, null ); 1242 1311 if ( false === $creds ) { -
soliloquy-lite/trunk/includes/admin/common.php
r2993325 r2996581 198 198 esc_url( $this->get_upgrade_link( 'http://soliloquywp.com/lite/', 'adminsidebar', 'unlockprosidebar' ) ) 199 199 ); 200 201 if ( ! current_user_can( 'manage_options' ) ) { 202 return; 203 } 200 204 201 205 $upgrade_link_position = key( -
soliloquy-lite/trunk/readme.txt
r2993325 r2996581 5 5 Tested up to: 6.4.1 6 6 Requires PHP: 5.6 7 Stable tag: 2.7.4 7 Stable tag: 2.7.4.1 8 8 License: GNU General Public License v2.0 or later 9 9 … … 259 259 260 260 == Changelog == 261 = 2.7.4.1 = 262 * Fixed: Notices for non-admin users in admin. 263 * Fixed: Capability checks for ajax calls 261 264 262 265 = 2.7.4 = -
soliloquy-lite/trunk/soliloquy-lite.php
r2993325 r2996581 6 6 * Author: Soliloquy Team 7 7 * Author URI: https://soliloquywp.com 8 * Version: 2.7.4 8 * Version: 2.7.4.1 9 9 * Text Domain: soliloquy 10 10 * Domain Path: languages … … 57 57 * @var string 58 58 */ 59 public $version = '2.7.4 ';59 public $version = '2.7.4.1'; 60 60 61 61 /**
Note: See TracChangeset
for help on using the changeset viewer.