Changeset 54349
- Timestamp:
- 09/28/2022 05:31:53 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r54210 r54349 1059 1059 * false if the script textdomain could not be loaded. 1060 1060 */ 1061 function load_script_textdomain( $handle, $domain = 'default', $path = null) {1061 function load_script_textdomain( $handle, $domain = 'default', $path = '' ) { 1062 1062 $wp_scripts = wp_scripts(); 1063 1063 … … 1066 1066 } 1067 1067 1068 $path = untrailingslashit( $path ); 1068 if ( is_string( $path ) ) { 1069 $path = untrailingslashit( $path ); 1070 } 1071 1069 1072 $locale = determine_locale(); 1070 1073 -
trunk/tests/phpunit/tests/dependencies/scripts.php
r54289 r54349 722 722 $wp_scripts->do_concat = true; 723 723 724 if ( PHP_VERSION_ID >= 80100 ) {725 /*726 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in727 * via hooked in filter functions until a more structural solution to the728 * "missing input validation" conundrum has been architected and implemented.729 */730 $this->expectDeprecation();731 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' );732 }733 734 724 $ver = get_bloginfo( 'version' ); 735 725 $suffix = wp_scripts_get_suffix(); … … 783 773 $wp_scripts->base_url = ''; 784 774 $wp_scripts->do_concat = true; 785 786 if ( PHP_VERSION_ID >= 80100 ) {787 /*788 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in789 * via hooked in filter functions until a more structural solution to the790 * "missing input validation" conundrum has been architected and implemented.791 */792 $this->expectDeprecation();793 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' );794 }795 775 796 776 $expected_tail = "<script type='text/javascript' src='/customize-dependency.js' id='customize-dependency-js'></script>\n"; -
trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
r53866 r54349 132 132 return $relative; 133 133 } 134 135 /** 136 * Tests that PHP 8.1 "passing null to non-nullable" deprecation notice 137 * is not thrown when passing the default `$path` to untrailingslashit() in the function. 138 * 139 * The notice that we should not see: 140 * `Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated`. 141 * 142 * @ticket 55967 143 */ 144 public function test_does_not_throw_deprecation_notice_for_rtrim_with_default_parameters() { 145 $handle = 'test-example-root'; 146 $src = '/wp-includes/js/script.js'; 147 148 wp_enqueue_script( $handle, $src ); 149 150 $expected = file_get_contents( DIR_TESTDATA . '/languages/en_US-813e104eb47e13dd4cc5af844c618754.json' ); 151 $this->assertSame( $expected, load_script_textdomain( $handle ) ); 152 } 134 153 }
Note: See TracChangeset
for help on using the changeset viewer.