Plugin Directory

Changeset 3227153


Ignore:
Timestamp:
01/23/2025 03:58:56 AM (14 months ago)
Author:
suiteplugins
Message:

Fixed security concern

Location:
gallery-for-ultimate-member
Files:
667 added
4 edited

Legend:

Unmodified
Added
Removed
  • gallery-for-ultimate-member/tags/1.0.6/trunk/vendor/cmb2/cmb2/includes/CMB2_Hookup.php

    r2489977 r3227153  
    1212 * @link      https://cmb2.io
    1313 */
    14 class CMB2_Hookup extends CMB2_Hookup_Base {
     14class CMB2_hookup extends CMB2_Hookup_Base {
    1515
    1616    /**
     
    141141                add_filter( "manage_{$post_type}_posts_columns", array( $this, 'register_column_headers' ) );
    142142                add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'column_display' ), 10, 2 );
    143                 add_filter( "manage_edit-{$post_type}_sortable_columns", array( $this, 'columns_sortable' ) );
    144                 add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
    145143            }
    146144        }
     
    156154            add_filter( 'manage_edit-comments_columns', array( $this, 'register_column_headers' ) );
    157155            add_action( 'manage_comments_custom_column', array( $this, 'column_display' ), 10, 3 );
    158             add_filter( "manage_edit-comments_sortable_columns", array( $this, 'columns_sortable' ) );
    159             add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
    160156        }
    161157
     
    177173            add_filter( 'manage_users_columns', array( $this, 'register_column_headers' ) );
    178174            add_filter( 'manage_users_custom_column', array( $this, 'return_column_display' ), 10, 3 );
    179             add_filter( "manage_users_sortable_columns", array( $this, 'columns_sortable' ) );
    180             add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
    181175        }
    182176
     
    223217                add_filter( "manage_edit-{$taxonomy}_columns", array( $this, 'register_column_headers' ) );
    224218                add_filter( "manage_{$taxonomy}_custom_column", array( $this, 'return_column_display' ), 10, 3 );
    225                 add_filter( "manage_edit-{$taxonomy}_sortable_columns", array( $this, 'columns_sortable' ) );
    226                 add_action( 'pre_get_posts', array( $this, 'columns_sortable_orderby' ) );
    227219            }
    228220        }
     
    341333     */
    342334    public function register_column_headers( $columns ) {
    343         foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
    344             if ( empty( $field['column'] ) ) {
     335        $fields = $this->cmb->prop( 'fields' );
     336
     337        foreach ( $fields as $key => $field ) {
     338            if ( ! isset( $field['column'] ) ) {
    345339                continue;
    346340            }
     
    349343
    350344            if ( false === $column['position'] ) {
     345
    351346                $columns[ $field['id'] ] = $column['name'];
     347
    352348            } else {
     349
    353350                $before = array_slice( $columns, 0, absint( $column['position'] ) );
    354351                $before[ $field['id'] ] = $column['name'];
     
    373370    public function column_display( $column_name, $object_id ) {
    374371        if ( isset( $this->columns[ $column_name ] ) ) {
    375             $field = new CMB2_Field( array(
    376                 'field_args'  => $this->columns[ $column_name ]['field'],
    377                 'object_type' => $this->object_type,
    378                 'object_id'   => $this->cmb->object_id( $object_id ),
    379                 'cmb_id'      => $this->cmb->cmb_id,
    380             ) );
    381 
    382             $this->cmb->get_field( $field )->render_column();
    383         }
    384     }
    385 
    386     /**
    387      * Returns the columns sortable array.
    388      *
    389      * @since 2.6.1
    390      *
    391      * @param array $columns An array of sortable columns.
    392      *
    393      * @return array $columns An array of sortable columns with CMB2 columns.
    394      */
    395     public function columns_sortable( $columns ) {
    396         foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
    397             if ( ! empty( $field['column'] ) && empty( $field['column']['disable_sortable'] ) ) {
    398                 $columns[ $field['id'] ] = $field['id'];
    399             }
    400         }
    401 
    402         return $columns;
    403     }
    404 
    405     /**
    406      * Return the query object to order by custom columns if selected
    407      *
    408      * @since 2.6.1
    409      *
    410      * @param object $query Object query from WordPress
    411      *
    412      * @return void
    413      */
    414     public function columns_sortable_orderby( $query ) {
    415         if ( ! is_admin() ) {
    416             return;
    417         }
    418 
    419         $orderby = $query->get( 'orderby' );
    420 
    421         foreach ( $this->cmb->prop( 'fields' ) as $key => $field ) {
    422             if (
    423                 empty( $field['column'] )
    424                 || ! empty( $field['column']['disable_sortable'] )
    425                 || $field['id'] !== $orderby
    426             ) {
    427                 continue;
    428             }
    429 
    430             $query->set( 'meta_key', $field['id'] );
    431 
    432             $type = $field['type'];
    433 
    434             if ( ! empty( $field['attributes']['type'] ) ) {
    435                 switch ( $field['attributes']['type'] ) {
    436                     case 'number':
    437                     case 'date':
    438                         $type = $field['attributes']['type'];
    439                         break;
    440                     case 'range':
    441                         $type = 'number';
    442                         break;
    443                 }
    444             }
    445 
    446             switch ( $type ) {
    447                 case 'number':
    448                 case 'text_date_timestamp':
    449                 case 'text_datetime_timestamp':
    450                 case 'text_money':
    451                     $query->set( 'orderby', 'meta_value_num' );
    452                     break;
    453                 case 'text_time':
    454                     $query->set( 'orderby', 'meta_value_time' );
    455                     break;
    456                 case 'text_date':
    457                     $query->set( 'orderby', 'meta_value_date' );
    458                     break;
    459 
    460                 default:
    461                     $query->set( 'orderby', 'meta_value' );
    462                     break;
    463             }
     372                $field = new CMB2_Field( array(
     373                    'field_args'  => $this->columns[ $column_name ]['field'],
     374                    'object_type' => $this->object_type,
     375                    'object_id'   => $this->cmb->object_id( $object_id ),
     376                    'cmb_id'      => $this->cmb->cmb_id,
     377                ) );
     378
     379                $this->cmb->get_field( $field )->render_column();
    464380        }
    465381    }
     
    538454     */
    539455    public function context_box_title_markup_open( $add_handle = true ) {
    540         $cmb_id = $this->cmb->cmb_id;
    541         $title  = $this->cmb->prop( 'title' );
    542         $screen = get_current_screen();
    543         $page   = $screen->id;
    544         $is_55  = CMB2_Utils::wp_at_least( '5.5' );
    545 
    546         add_filter( "postbox_classes_{$page}_{$cmb_id}", array( $this, 'postbox_classes' ) );
    547 
    548         $hidden_class = '';
    549 
    550         if ( $is_55 ) {
    551 
    552             // get_hidden_meta_boxes() doesn't apply in the block editor.
    553             $is_hidden = ! $screen->is_block_editor() && in_array( $cmb_id, get_hidden_meta_boxes( $screen ), true );
    554 
    555             $hidden_class = $is_hidden
    556                 ? ' hide-if-js'
    557                 : '';
    558         }
    559 
    560         $toggle_button = '<button type="button" class="handlediv button-link" aria-expanded="true"><span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $title ) . '</span><span class="toggle-indicator" aria-hidden="true"></span></button>';
    561         $title_tag = '<h2 class="hndle"><span>' . esc_attr( $title ) . '</span></h2>' . "\n";
    562 
    563         echo '<div id="' . $cmb_id . '" class="' . postbox_classes( $cmb_id, $page ) . $hidden_class . '">' . "\n";
     456        $title = $this->cmb->prop( 'title' );
     457
     458        $page = get_current_screen()->id;
     459        add_filter( "postbox_classes_{$page}_{$this->cmb->cmb_id}", array( $this, 'postbox_classes' ) );
     460
     461        echo '<div id="' . $this->cmb->cmb_id . '" class="' . postbox_classes( $this->cmb->cmb_id, $page ) . '">' . "\n";
    564462
    565463        if ( $add_handle ) {
    566464
    567             if ( $is_55 ) {
    568                 echo '<div class="postbox-header">';
    569                 echo $title_tag;
    570 
    571                 echo '<div class="handle-actions hide-if-no-js">';
    572                 echo $toggle_button;
    573                 echo '</div>';
    574 
    575                 echo '</div>' . "\n";
    576 
    577             } else {
    578                 echo $toggle_button;;
    579                 echo $title_tag;
    580             }
    581 
     465            echo '<button type="button" class="handlediv button-link" aria-expanded="true">';
     466                echo '<span class="screen-reader-text">' . sprintf( __( 'Toggle panel: %s' ), $title ) . '</span>';
     467                echo '<span class="toggle-indicator" aria-hidden="true"></span>';
     468            echo '</button>';
     469
     470            echo '<h2 class="hndle"><span>' . esc_attr( $title ) . '</span></h2>' . "\n";
    582471            echo '<div class="inside">' . "\n";
    583472        }
     
    713602     */
    714603    public function metabox_callback() {
    715         $object_id = 'comment' === $this->object_type ? get_comment_ID() : get_the_ID();
     604        $object_id = 'comment' == $this->object_type ? get_comment_ID() : get_the_ID();
    716605        $this->cmb->show_form( $object_id, $this->object_type );
    717606    }
     
    725614     */
    726615    public function user_new_metabox( $section ) {
    727         if ( $section === $this->cmb->prop( 'new_user_section' ) ) {
     616        if ( $section == $this->cmb->prop( 'new_user_section' ) ) {
    728617            $object_id = $this->cmb->object_id();
    729618            $this->cmb->object_id( isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id );
     
    844733            ! $this->can_save( $post_type )
    845734            // Check user editing permissions.
    846             || ( 'page' === $post_type && ! current_user_can( 'edit_page', $post_id ) )
     735            || ( 'page' == $post_type && ! current_user_can( 'edit_page', $post_id ) )
    847736            || ! current_user_can( 'edit_post', $post_id )
    848737        );
  • gallery-for-ultimate-member/trunk/gallery-for-ultimate-member.php

    r3204552 r3227153  
    44 * Plugin URI: https://suiteplugins.com/
    55 * Description: Allow your user to upload photos from their Ultimate Member profile
    6  * Version: 1.1.2
     6 * Version: 1.1.3
    77 * Requires at least: 5.2
    88 * Requires PHP:      5.4
     
    2525define( 'UM_GALLERY_LITE_PATH', plugin_dir_path( __FILE__ ) );
    2626define( 'UM_GALLERY_LITE_PLUGIN', plugin_basename( __FILE__ ) );
    27 define( 'UM_GALLERY_LITE_VERSION', '1.1.1' );
     27define( 'UM_GALLERY_LITE_VERSION', '1.1.3' );
    2828require_once ABSPATH . 'wp-admin/includes/plugin.php';
    2929
  • gallery-for-ultimate-member/trunk/includes/um-gallery-ajax.php

    r3175140 r3227153  
    511511
    512512        public function um_gallery_fetch_remote_thumbnail() {
    513             $results = array();
    514             $request = wp_remote_get( esc_url( $_GET['videoUrl'] ) );
    515             if ( is_wp_error( $request ) ) {
    516                 return false; // Bail early
    517             }
    518 
    519             $body = wp_remote_retrieve_body( $request );
    520 
    521             $old_libxml_error = libxml_use_internal_errors( true );
    522             $doc              = new DOMDocument();
    523             $doc->loadHTML( $body );
    524 
    525             libxml_use_internal_errors( $old_libxml_error );
    526             $tags = $doc->getElementsByTagName( 'meta' );
    527             if ( ! $tags || $tags->length === 0 ) {
    528                 return false;
    529             }
    530             $meta_og_img = null;
    531             foreach ( $tags as $meta ) {
    532                 // If the property attribute of the meta tag is og:image
    533                 if ( $meta->getAttribute( 'property' ) == 'og:image' ) {
    534                     // Assign the value from content attribute to $meta_og_img
    535                     $meta_og_img = $meta->getAttribute( 'content' );
    536                 }
    537             }
    538 
    539             if ( $meta_og_img ) {
    540                 $results['thumbnail'] = $meta_og_img;
    541             }
    542             wp_send_json( $results );
     513            wp_send_json_error();
    543514        }
    544515    }
  • gallery-for-ultimate-member/trunk/readme.txt

    r3204552 r3227153  
    55Requires at least: 4.6
    66Requires PHP: 5.4
    7 Tested up to: 6.6.2
    8 Stable tag: 1.1.2
     7Tested up to: 6.7.1
     8Stable tag: 1.1.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    115115== Changelog ==
    116116
     117= 1.1.3 =
     118Dev: Removed Hudl support for security reasons
     119
    117120= 1.1.2 =
    118121Dev: Updated escapes/sanitization throughout plugin
Note: See TracChangeset for help on using the changeset viewer.