- Timestamp:
- 03/08/2016 05:14:52 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/random_compat/byte_safe_strings.php
r35365 r36886 51 51 ); 52 52 } 53 53 54 return mb_strlen($binary_string, '8bit'); 54 55 } 56 55 57 } else { 56 58 /** … … 78 80 79 81 if (!function_exists('RandomCompat_substr')) { 82 80 83 if ( 81 defined('MB_OVERLOAD_STRING') && 84 defined('MB_OVERLOAD_STRING') 85 && 82 86 ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING 83 87 ) { … … 103 107 ); 104 108 } 109 105 110 if (!is_int($start)) { 106 111 throw new TypeError( … … 108 113 ); 109 114 } 115 110 116 if ($length === null) { 111 117 /** … … 119 125 ); 120 126 } 127 121 128 return mb_substr($binary_string, $start, $length, '8bit'); 122 129 } 130 123 131 } else { 132 124 133 /** 125 134 * substr() implementation that isn't brittle to mbstring.func_overload … … 142 151 ); 143 152 } 153 144 154 if (!is_int($start)) { 145 155 throw new TypeError( … … 147 157 ); 148 158 } 159 149 160 if ($length !== null) { 150 161 if (!is_int($length)) { … … 153 164 ); 154 165 } 166 155 167 return substr($binary_string, $start, $length); 156 168 } 169 157 170 return substr($binary_string, $start); 158 171 }
Note: See TracChangeset
for help on using the changeset viewer.