1 ) { $path = rtrim( $path, '/' ); } if ( '' === $path || preg_match( '/[\x00-\x1F\x7F]/', $path ) ) { return null; } return $keep_query && '' !== $query ? $path . '?' . $query : $path; } /** * Path part of a normalized key (without query). * * @param string $key Normalized key. */ public static function strip_query( string $key ): string { $qpos = strpos( $key, '?' ); return false === $qpos ? $key : substr( $key, 0, $qpos ); } }