| @@ -2,13 +2,13 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Responsible for holding instances of Charitable helper objects. |
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Classes/Charitable_Registry |
| 6 | - * @author Eric Daams | |
| 7 | - * @copyright Copyright (c) 2018, Studio 164a | |
| 6 | + * @author David Bisset | |
| 7 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.5.0 |
| 10 | - * @version 1.5.0 | |
| 10 | + * @version 1.6.49 | |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // Exit if accessed directly. |
| 14 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -111,9 +111,9 @@ | ||
| 111 | 111 | * @param string $class_key The class to return. |
| 112 | 112 | * @return string |
| 113 | 113 | */ |
| 114 | 114 | protected function get_class_name( $class_key ) { |
| 115 | - if ( 0 === strpos( $class_key, 'Charitable_' ) ) { | |
| 115 | + if ( 0 === strpos( $class_key, 'Charitable_' ) || 0 === strpos( $class_key, '\\' ) ) { | |
| 116 | 116 | return $class_key; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $class_words = str_replace( '_', ' ', $class_key ); |
| @@ -131,9 +131,9 @@ | ||
| 131 | 131 | */ |
| 132 | 132 | protected function get_class_instance( $class ) { |
| 133 | 133 | if ( ! class_exists( $class ) ) { |
| 134 | 134 | /* translators: %s: class name */ |
| 135 | - wp_die( sprintf( _x( 'Class %s does not exist.', 'error message when non-existent class is called', 'charitable' ), $class ) ); | |
| 135 | + wp_die( esc_html( sprintf( _x( 'Class %s does not exist.', 'error message when non-existent class is called', 'charitable' ), $class ) ) ); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | return new $class; |
| 139 | 139 | } |