Ticket #22300: 22300.2.diff
| File 22300.2.diff, 2.5 KB (added by , 13 years ago) |
|---|
-
wp-includes/formatting.php
1431 1431 * 1432 1432 * @since 2.2.0 1433 1433 * 1434 * @param array|string $value The array or string to be encoded.1435 * @return array|string $value The encoded array (or string from the callback).1434 * @param object|array|string $value The array or string to be encoded. 1435 * @return object|array|string $value The encoded array (or string from the callback). 1436 1436 */ 1437 function urlencode_deep($value) { 1438 $value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value); 1439 return $value; 1437 function urlencode_deep( $value ) { 1438 if ( is_object( $value ) ) { 1439 foreach( $value as $property => $property_value ) 1440 $value->$property = urlencode_deep( $property_value ); 1441 1442 return $value; 1443 } else if ( is_array( $value ) ) { 1444 return array_map( 'urlencode_deep', $value ); 1445 } else { 1446 return urlencode( $value ); 1447 } 1440 1448 } 1441 1449 1442 1450 /** … … 1444 1452 * 1445 1453 * @since 3.4.0 1446 1454 * 1447 * @param array|string $value The array or string to be encoded.1448 * @return array|string $value The encoded array (or string from the callback).1455 * @param object|array|string $value The array or string to be encoded. 1456 * @return object|array|string $value The encoded array (or string from the callback). 1449 1457 */ 1450 1458 function rawurlencode_deep( $value ) { 1451 return is_array( $value ) ? array_map( 'rawurlencode_deep', $value ) : rawurlencode( $value ); 1459 if ( is_object( $value ) ) { 1460 foreach( $value as $property => $property_value ) 1461 $value->$property = rawurlencode_deep( $property_value ); 1462 1463 return $value; 1464 } else if ( is_array( $value ) ) { 1465 return array_map( 'rawurlencode_deep', $value ); 1466 } else { 1467 return rawurlencode( $value ); 1468 } 1452 1469 } 1453 1470 1454 1471 /** 1472 * Navigates through a urlencoded variable and decodes the values. 1473 * 1474 * 1475 * @since 1476 * 1477 * @param string $value The array or string to be encoded. 1478 * @return object|array|string $value The encoded array (or string from the callback). 1479 */ 1480 function urldecode_deep( $value ) { 1481 if ( is_object( $value ) ) { 1482 foreach( $value as $property => $property_value ) 1483 $value->$property = urldecode_deep( $property_value ); 1484 1485 return $value; 1486 } else if ( is_array( $value ) ) { 1487 return array_map( 'urldecode_deep', $value ); 1488 } else { 1489 return urldecode( $value ); 1490 } 1491 } 1492 1493 /** 1455 1494 * Converts email addresses characters to HTML entities to block spam bots. 1456 1495 * 1457 1496 * @since 0.71