Changeset 11875 for trunk/wp-includes/compat.php
- Timestamp:
- 08/25/2009 07:48:59 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/compat.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/compat.php
r10707 r11875 57 57 } 58 58 59 if ( ! function_exists('hash_hmac') ):59 if ( !function_exists('hash_hmac') ): 60 60 function hash_hmac($algo, $data, $key, $raw_output = false) { 61 61 $packs = array('md5' => 'H32', 'sha1' => 'H40'); … … 78 78 endif; 79 79 80 if ( ! function_exists('mb_substr') ):80 if ( !function_exists('mb_substr') ): 81 81 function mb_substr( $str, $start, $length=null, $encoding=null ) { 82 82 return _mb_substr($str, $start, $length, $encoding); … … 116 116 } 117 117 118 ?> 118 // For PHP < 5.2.0 119 if ( !function_exists('json_encode') ) { 120 function json_encode( $string ) { 121 global $wp_json; 122 123 if ( !is_a($wp_json, 'Services_JSON') ) { 124 require_once( 'class-json.php' ); 125 $wp_json = new Services_JSON(); 126 } 127 128 return $wp_json->encode( $string ); 129 } 130 } 131 132 if ( !function_exists('json_decode') ) { 133 function json_decode( $string ) { 134 global $wp_json; 135 136 if ( !is_a($wp_json, 'Services_JSON') ) { 137 require_once( 'class-json.php' ); 138 $wp_json = new Services_JSON(); 139 } 140 141 return $wp_json->decode( $string ); 142 } 143 }
Note: See TracChangeset
for help on using the changeset viewer.