Changeset 54960
- Timestamp:
- 12/12/2022 08:19:49 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pomo/streams.php
r54133 r54960 86 86 87 87 /** 88 * @param string $ string88 * @param string $input_string 89 89 * @param int $start 90 90 * @param int $length 91 91 * @return string 92 92 */ 93 public function substr( $ string, $start, $length ) {93 public function substr( $input_string, $start, $length ) { 94 94 if ( $this->is_overloaded ) { 95 return mb_substr( $ string, $start, $length, 'ascii' );95 return mb_substr( $input_string, $start, $length, 'ascii' ); 96 96 } else { 97 return substr( $ string, $start, $length );98 } 99 } 100 101 /** 102 * @param string $ string97 return substr( $input_string, $start, $length ); 98 } 99 } 100 101 /** 102 * @param string $input_string 103 103 * @return int 104 104 */ 105 public function strlen( $ string ) {105 public function strlen( $input_string ) { 106 106 if ( $this->is_overloaded ) { 107 return mb_strlen( $ string, 'ascii' );107 return mb_strlen( $input_string, 'ascii' ); 108 108 } else { 109 return strlen( $ string );110 } 111 } 112 113 /** 114 * @param string $ string109 return strlen( $input_string ); 110 } 111 } 112 113 /** 114 * @param string $input_string 115 115 * @param int $chunk_size 116 116 * @return array 117 117 */ 118 public function str_split( $ string, $chunk_size ) {118 public function str_split( $input_string, $chunk_size ) { 119 119 if ( ! function_exists( 'str_split' ) ) { 120 $length = $this->strlen( $ string );120 $length = $this->strlen( $input_string ); 121 121 $out = array(); 122 122 for ( $i = 0; $i < $length; $i += $chunk_size ) { 123 $out[] = $this->substr( $ string, $i, $chunk_size );123 $out[] = $this->substr( $input_string, $i, $chunk_size ); 124 124 } 125 125 return $out; 126 126 } else { 127 return str_split( $ string, $chunk_size );127 return str_split( $input_string, $chunk_size ); 128 128 } 129 129 }
Note: See TracChangeset
for help on using the changeset viewer.