Making WordPress.org

Changeset 13086


Ignore:
Timestamp:
12/23/2023 09:23:48 AM (9 months ago)
Author:
dd32
Message:

Translate: Sanitize the search & filter parameters to avoid PHP Warnings & Fatals when set to arrays instead of strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php

    r12548 r13086  
    4848        $search = gp_get( 's', '' );
    4949        $filter = gp_get( 'filter', false );
    50         $without_editors = gp_get( 'without-editors', false );
     50        $without_editors = (bool) gp_get( 'without-editors', false );
     51
     52        if ( $search && ! is_string( $search ) ) {
     53            $search = '';
     54        }
     55        if ( $filter && ! is_string( $filter ) ) {
     56            $filter = false;
     57        }
    5158
    5259        $locale = GP_Locales::by_slug( $locale_slug );
Note: See TracChangeset for help on using the changeset viewer.