Changeset 3413539
- Timestamp:
- 12/07/2025 02:17:12 PM (3 months ago)
- Location:
- 0-day-analytics
- Files:
-
- 4 edited
-
tags/4.3.1/classes/vendor/controllers/class-endpoints.php (modified) (10 diffs)
-
tags/4.3.1/classes/vendor/lists/views/class-snippets-view.php (modified) (6 diffs)
-
trunk/classes/vendor/controllers/class-endpoints.php (modified) (10 diffs)
-
trunk/classes/vendor/lists/views/class-snippets-view.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
0-day-analytics/tags/4.3.1/classes/vendor/controllers/class-endpoints.php
r3393178 r3413539 48 48 public static $endpoints = array( 49 49 self::class => array( 50 'live' => array(50 'live' => array( 51 51 'class' => Logs_List::class, 52 52 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 65 65 ), 66 66 ), 67 'severity' => array(67 'severity' => array( 68 68 'class' => Logs_List::class, 69 69 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 94 94 ), 95 95 ), 96 'single_severity' => array(96 'single_severity' => array( 97 97 'class' => Logs_List::class, 98 98 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 118 118 ), 119 119 ), 120 'requests' => array(120 'requests' => array( 121 121 'class' => Requests_List::class, 122 122 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 147 147 ), 148 148 ), 149 'cron_run' => array(149 'cron_run' => array( 150 150 'class' => Crons_Helper::class, 151 151 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 171 171 ), 172 172 ), 173 'drop_table' => array(173 'drop_table' => array( 174 174 'class' => Common_Table::class, 175 175 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 196 196 ), 197 197 ), 198 'truncate_table' => array(198 'truncate_table' => array( 199 199 'class' => Common_Table::class, 200 200 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 221 221 ), 222 222 ), 223 'get_table_record' => array(223 'get_table_record' => array( 224 224 'class' => Common_Table::class, 225 225 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 252 252 ), 253 253 ), 254 'get_fatals_record' => array(254 'get_fatals_record' => array( 255 255 'class' => Common_Table::class, 256 256 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 308 308 ), 309 309 ), 310 'mail_body' => array(310 'mail_body' => array( 311 311 'class' => WP_Mail_List::class, 312 312 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', -
0-day-analytics/tags/4.3.1/classes/vendor/lists/views/class-snippets-view.php
r3413453 r3413539 103 103 $tags = isset( $_POST['snippet_tags'] ) ? Snippet_Entity::sanitize_tags( $_POST['snippet_tags'] ) : ''; 104 104 $code = isset( $_POST['snippet_code'] ) ? \wp_unslash( $_POST['snippet_code'] ) : ''; 105 $scope = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE;106 $scopes = array_keys( Snippet_Entity::get_execution_scopes() );105 $scope = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE; 106 $scopes = array_keys( Snippet_Entity::get_execution_scopes() ); 107 107 if ( ! in_array( $scope, $scopes, true ) ) { 108 108 $scope = Snippet_Entity::SCOPE_EVERYWHERE; … … 172 172 ); 173 173 174 if ( 0 === $snippet_id ) { 175 unset( $data['id'] ); 176 } 177 174 178 Snippet_Entity::insert( $data ); 175 179 … … 398 402 $scope_value = Snippet_Entity::SCOPE_EVERYWHERE; 399 403 } 400 $hook_value = $snippet['execution_hook'] ?? 'init';401 $priority_value = (int) ( $snippet['hook_priority'] ?? 10 );404 $hook_value = $snippet['execution_hook'] ?? 'init'; 405 $priority_value = (int) ( $snippet['hook_priority'] ?? 10 ); 402 406 if ( $priority_value <= 0 ) { 403 407 $priority_value = 10; 404 408 } 405 $shortcode_value = $snippet['shortcode_tag'] ?? '';406 $conditions_value = $snippet['run_conditions'] ?? '';409 $shortcode_value = $snippet['shortcode_tag'] ?? ''; 410 $conditions_value = $snippet['run_conditions'] ?? ''; 407 411 $conditions_preview = '' !== $conditions_value ? Snippet_Condition_Evaluator::get_normalized_rules( $conditions_value ) : array(); 408 $execute_url = '';412 $execute_url = ''; 409 413 if ( $is_edit && $snippet_id > 0 && 'php' === ( $snippet['type'] ?? 'php' ) ) { 410 414 $execute_url = \wp_nonce_url( … … 555 559 $operator = ( 'neq' === ( $rule['operator'] ?? 'eq' ) ) ? '!=' : '='; 556 560 $values = array(); 557 foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) {558 $values[] = \sanitize_text_field( (string) $preview_value );559 }561 foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) { 562 $values[] = \sanitize_text_field( (string) $preview_value ); 563 } 560 564 ?> 561 565 <li> … … 697 701 private static function print_execution_notice( array $data ): void { 698 702 static $share_script_output = false; 699 $status_class = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error';703 $status_class = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error'; 700 704 ?> 701 705 <style> … … 723 727 <?php endif; ?> 724 728 </div> 725 <?php if ( ! $share_script_output ) : $share_script_output = true; ?> 729 <?php 730 if ( ! $share_script_output ) : 731 $share_script_output = true; 732 ?> 726 733 <script> 727 734 (function($){ -
0-day-analytics/trunk/classes/vendor/controllers/class-endpoints.php
r3393178 r3413539 48 48 public static $endpoints = array( 49 49 self::class => array( 50 'live' => array(50 'live' => array( 51 51 'class' => Logs_List::class, 52 52 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 65 65 ), 66 66 ), 67 'severity' => array(67 'severity' => array( 68 68 'class' => Logs_List::class, 69 69 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 94 94 ), 95 95 ), 96 'single_severity' => array(96 'single_severity' => array( 97 97 'class' => Logs_List::class, 98 98 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 118 118 ), 119 119 ), 120 'requests' => array(120 'requests' => array( 121 121 'class' => Requests_List::class, 122 122 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 147 147 ), 148 148 ), 149 'cron_run' => array(149 'cron_run' => array( 150 150 'class' => Crons_Helper::class, 151 151 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 171 171 ), 172 172 ), 173 'drop_table' => array(173 'drop_table' => array( 174 174 'class' => Common_Table::class, 175 175 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 196 196 ), 197 197 ), 198 'truncate_table' => array(198 'truncate_table' => array( 199 199 'class' => Common_Table::class, 200 200 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 221 221 ), 222 222 ), 223 'get_table_record' => array(223 'get_table_record' => array( 224 224 'class' => Common_Table::class, 225 225 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 252 252 ), 253 253 ), 254 'get_fatals_record' => array(254 'get_fatals_record' => array( 255 255 'class' => Common_Table::class, 256 256 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', … … 308 308 ), 309 309 ), 310 'mail_body' => array(310 'mail_body' => array( 311 311 'class' => WP_Mail_List::class, 312 312 'namespace' => self::ENDPOINT_ROOT_NAME . '/v1', -
0-day-analytics/trunk/classes/vendor/lists/views/class-snippets-view.php
r3413453 r3413539 103 103 $tags = isset( $_POST['snippet_tags'] ) ? Snippet_Entity::sanitize_tags( $_POST['snippet_tags'] ) : ''; 104 104 $code = isset( $_POST['snippet_code'] ) ? \wp_unslash( $_POST['snippet_code'] ) : ''; 105 $scope = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE;106 $scopes = array_keys( Snippet_Entity::get_execution_scopes() );105 $scope = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE; 106 $scopes = array_keys( Snippet_Entity::get_execution_scopes() ); 107 107 if ( ! in_array( $scope, $scopes, true ) ) { 108 108 $scope = Snippet_Entity::SCOPE_EVERYWHERE; … … 172 172 ); 173 173 174 if ( 0 === $snippet_id ) { 175 unset( $data['id'] ); 176 } 177 174 178 Snippet_Entity::insert( $data ); 175 179 … … 398 402 $scope_value = Snippet_Entity::SCOPE_EVERYWHERE; 399 403 } 400 $hook_value = $snippet['execution_hook'] ?? 'init';401 $priority_value = (int) ( $snippet['hook_priority'] ?? 10 );404 $hook_value = $snippet['execution_hook'] ?? 'init'; 405 $priority_value = (int) ( $snippet['hook_priority'] ?? 10 ); 402 406 if ( $priority_value <= 0 ) { 403 407 $priority_value = 10; 404 408 } 405 $shortcode_value = $snippet['shortcode_tag'] ?? '';406 $conditions_value = $snippet['run_conditions'] ?? '';409 $shortcode_value = $snippet['shortcode_tag'] ?? ''; 410 $conditions_value = $snippet['run_conditions'] ?? ''; 407 411 $conditions_preview = '' !== $conditions_value ? Snippet_Condition_Evaluator::get_normalized_rules( $conditions_value ) : array(); 408 $execute_url = '';412 $execute_url = ''; 409 413 if ( $is_edit && $snippet_id > 0 && 'php' === ( $snippet['type'] ?? 'php' ) ) { 410 414 $execute_url = \wp_nonce_url( … … 555 559 $operator = ( 'neq' === ( $rule['operator'] ?? 'eq' ) ) ? '!=' : '='; 556 560 $values = array(); 557 foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) {558 $values[] = \sanitize_text_field( (string) $preview_value );559 }561 foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) { 562 $values[] = \sanitize_text_field( (string) $preview_value ); 563 } 560 564 ?> 561 565 <li> … … 697 701 private static function print_execution_notice( array $data ): void { 698 702 static $share_script_output = false; 699 $status_class = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error';703 $status_class = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error'; 700 704 ?> 701 705 <style> … … 723 727 <?php endif; ?> 724 728 </div> 725 <?php if ( ! $share_script_output ) : $share_script_output = true; ?> 729 <?php 730 if ( ! $share_script_output ) : 731 $share_script_output = true; 732 ?> 726 733 <script> 727 734 (function($){
Note: See TracChangeset
for help on using the changeset viewer.