Making WordPress.org


Ignore:
Timestamp:
07/24/2025 01:38:04 AM (11 months ago)
Author:
dd32
Message:

API: Trac helpers: Avoid fatals with invalid inputs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/index.php

    r11544 r14489  
    55require __DIR__ . '/functions.php';
    66
    7 $trac          = preg_replace( '![^a-z]!', '', $_GET['trac'] ?? '' );
     7$trac          = $_GET['trac'] ?? '';
     8$trac          = is_string( $trac ) ? $trac : '';
     9$trac          = preg_replace( '![^a-z]!', '', $trac );
    810$ticket        = intval( $_GET['ticket'] ?? 0 );
    911$author        = wp_unslash( $_GET['author'] ?? '' );
     12$author        = is_string( $author ) ? $author : '';
    1013$authenticated = ! empty( $_GET['authenticated'] ); // Longer caches for logged out requests.
    1114
Note: See TracChangeset for help on using the changeset viewer.