File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,12 @@ public static function get_terms() {
526526 public function get_posts ( $ request ) {
527527 $ args = $ request ->get_query_params ();
528528
529+ // Enforce safe defaults to avoid exposing sensitive content.
530+ // 1) Force post status to publish only (non-sensitive).
531+ $ args ['post_status ' ] = 'publish ' ;
532+ // 2) Exclude password-protected content explicitly.
533+ $ args ['has_password ' ] = false ;
534+
529535 $ query = new WP_Query ( $ args );
530536
531537 foreach ( $ query ->posts as $ key =>$ post ) {
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public function register_route() {
7676 'methods ' => 'POST ' ,
7777 'callback ' => array ( $ this , 'get_design_library_image ' ),
7878 'permission_callback ' => function () {
79- return current_user_can ( 'edit_posts ' );
79+ return current_user_can ( 'upload_files ' );
8080 },
8181 'args ' => array (
8282 'image_url ' => array (
You can’t perform that action at this time.
0 commit comments