Make WordPress Core

Ticket #48852: 48852.patch

File 48852.patch, 628 bytes (added by dkarfa, 7 years ago)
  • src/wp-includes/class-wp-theme.php

     
    440440         * @return string Theme name, ready for display (translated)
    441441         */
    442442        public function __toString() {
    443                 return (string) $this->display( 'Name' );
     443                $response = null;
     444                try {
     445            $response = (string) $this->display( 'Name' );
     446        } catch (Exception $e) {
     447                        $response = new WP_Error( 'theme_name_missing', __( $e->getMessage() ) );
     448                }
     449                return $response;
    444450        }
    445451
    446452        /**