Changeset 54950 for trunk/src/wp-includes/class-wpdb.php
- Timestamp:
- 12/08/2022 05:26:17 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wpdb.php
r54733 r54950 1245 1245 * @see esc_sql() 1246 1246 * 1247 * @param string $ string1247 * @param string $data 1248 1248 * @return string 1249 1249 */ 1250 public function _weak_escape( $ string) {1250 public function _weak_escape( $data ) { 1251 1251 if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { 1252 1252 _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); 1253 1253 } 1254 return addslashes( $ string);1254 return addslashes( $data ); 1255 1255 } 1256 1256 … … 1263 1263 * @see mysql_real_escape_string() 1264 1264 * 1265 * @param string $ stringString to escape.1265 * @param string $data String to escape. 1266 1266 * @return string Escaped string. 1267 1267 */ 1268 public function _real_escape( $ string) {1269 if ( ! is_scalar( $ string) ) {1268 public function _real_escape( $data ) { 1269 if ( ! is_scalar( $data ) ) { 1270 1270 return ''; 1271 1271 } … … 1273 1273 if ( $this->dbh ) { 1274 1274 if ( $this->use_mysqli ) { 1275 $escaped = mysqli_real_escape_string( $this->dbh, $ string);1275 $escaped = mysqli_real_escape_string( $this->dbh, $data ); 1276 1276 } else { 1277 $escaped = mysql_real_escape_string( $ string, $this->dbh );1277 $escaped = mysql_real_escape_string( $data, $this->dbh ); 1278 1278 } 1279 1279 } else { … … 1284 1284 _doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' ); 1285 1285 1286 $escaped = addslashes( $ string);1286 $escaped = addslashes( $data ); 1287 1287 } 1288 1288 … … 1355 1355 * @since 2.3.0 1356 1356 * 1357 * @param string $ stringString to escape.1358 */ 1359 public function escape_by_ref( &$ string) {1360 if ( ! is_float( $ string) ) {1361 $ string = $this->_real_escape( $string);1357 * @param string $data String to escape. 1358 */ 1359 public function escape_by_ref( &$data ) { 1360 if ( ! is_float( $data ) ) { 1361 $data = $this->_real_escape( $data ); 1362 1362 } 1363 1363 } … … 3162 3162 * @since 4.2.0 3163 3163 * 3164 * @param string $ string String to check.3164 * @param string $input_string String to check. 3165 3165 * @return bool True if ASCII, false if not. 3166 3166 */ 3167 protected function check_ascii( $ string ) {3167 protected function check_ascii( $input_string ) { 3168 3168 if ( function_exists( 'mb_check_encoding' ) ) { 3169 if ( mb_check_encoding( $ string, 'ASCII' ) ) {3169 if ( mb_check_encoding( $input_string, 'ASCII' ) ) { 3170 3170 return true; 3171 3171 } 3172 } elseif ( ! preg_match( '/[^\x00-\x7F]/', $ string ) ) {3172 } elseif ( ! preg_match( '/[^\x00-\x7F]/', $input_string ) ) { 3173 3173 return true; 3174 3174 }
Note: See TracChangeset
for help on using the changeset viewer.