### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
|
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | | function _weak_escape($string) { |
| 473 | | return addslashes($string); |
| 474 | | } |
| 475 | | |
| 476 | 472 | function _real_escape($string) { |
| 477 | 473 | if ( $this->dbh && $this->real_escape ) |
| 478 | 474 | return mysql_real_escape_string( $string, $this->dbh ); |
| … |
… |
|
| 503 | 499 | * @param string|array $data |
| 504 | 500 | * @return string query safe string |
| 505 | 501 | */ |
| 506 | | function escape($data) { |
| 507 | | if ( is_array($data) ) { |
| 508 | | foreach ( (array) $data as $k => $v ) { |
| 509 | | if ( is_array($v) ) |
| 510 | | $data[$k] = $this->escape( $v ); |
| 511 | | else |
| 512 | | $data[$k] = $this->_weak_escape( $v ); |
| 513 | | } |
| 514 | | } else { |
| 515 | | $data = $this->_weak_escape( $data ); |
| 516 | | } |
| 517 | | |
| 518 | | return $data; |
| | 502 | function escape( $data ) { |
| | 503 | if ( is_array ( $data ) ) |
| | 504 | return array_map( array( &$this, 'escape' ), $data ); |
| | 505 | |
| | 506 | return addslashes( $data ); |
| 519 | 507 | } |
| 520 | 508 | |
| 521 | 509 | /** |