Changeset 628 for trunk/wp-includes/functions.php
- Timestamp:
- 12/18/2003 09:36:13 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r617 r628 229 229 function convert_chars($content,$flag='obsolete attribute left there for backwards compatibility') { // html/unicode entities output 230 230 231 global $use_htmltrans, $ b2_htmltrans, $b2_htmltranswinuni;231 global $use_htmltrans, $wp_htmltrans, $wp_htmltranswinuni; 232 232 233 233 // removes metadata tags … … 242 242 // converts HTML-entities to their display values in order to convert them again later 243 243 $content = preg_replace('/['.chr(127).'-'.chr(255).']/e', '"&#".ord(\'\0\').";"', $content ); 244 $content = strtr($content, $ b2_htmltrans);244 $content = strtr($content, $wp_htmltrans); 245 245 246 246 // now converting: Windows CP1252 => Unicode (valid HTML) 247 247 // (if you've ever pasted text from MSWord, you'll understand) 248 248 249 $content = strtr($content, $ b2_htmltranswinuni);249 $content = strtr($content, $wp_htmltranswinuni); 250 250 251 251 } … … 260 260 261 261 function convert_bbcode($content) { 262 global $ b2_bbcode, $use_bbcode;262 global $wp_bbcode, $use_bbcode; 263 263 if ($use_bbcode) { 264 $content = preg_replace($ b2_bbcode["in"], $b2_bbcode["out"], $content);264 $content = preg_replace($wp_bbcode["in"], $wp_bbcode["out"], $content); 265 265 } 266 266 $content = convert_bbcode_email($content); … … 284 284 285 285 function convert_gmcode($content) { 286 global $ b2_gmcode, $use_gmcode;286 global $wp_gmcode, $use_gmcode; 287 287 if ($use_gmcode) { 288 $content = preg_replace($ b2_gmcode["in"], $b2_gmcode["out"], $content);288 $content = preg_replace($wp_gmcode["in"], $wp_gmcode["out"], $content); 289 289 } 290 290 return $content; … … 293 293 function convert_smilies($text) { 294 294 global $smilies_directory, $use_smilies; 295 global $ b2_smiliessearch, $b2_smiliesreplace;295 global $wp_smiliessearch, $wp_smiliesreplace; 296 296 $output = ''; 297 297 if ($use_smilies) { … … 302 302 $content = $textarr[$i]; 303 303 if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag 304 $content = str_replace($ b2_smiliessearch, $b2_smiliesreplace, $content);304 $content = str_replace($wp_smiliessearch, $wp_smiliesreplace, $content); 305 305 } 306 306 $output .= $content; … … 1031 1031 function pingback($content, $post_ID) { 1032 1032 // original code by Mort (http://mort.mine.nu:8080) 1033 global $siteurl, $blogfilename, $ b2_version;1033 global $siteurl, $blogfilename, $wp_version; 1034 1034 $log = debug_fopen('./pingback.log', 'a'); 1035 1035 $post_links = array(); … … 1100 1100 1101 1101 // Send the GET request 1102 $request = "GET $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: b2/$ b2_version PHP/" . phpversion() . "\r\n\r\n";1102 $request = "GET $path HTTP/1.1\r\nHost: $host\r\nUser-Agent: b2/$wp_version PHP/" . phpversion() . "\r\n\r\n"; 1103 1103 ob_end_flush(); 1104 1104 fputs($fp, $request); … … 1554 1554 } 1555 1555 1556 function start_ b2() {1556 function start_wp() { 1557 1557 global $post, $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages; 1558 1558 global $preview_userid,$preview_date,$preview_content,$preview_title,$preview_category,$preview_notify,$preview_make_clickable,$preview_autobr; … … 1610 1610 1611 1611 function apply_filters($tag, $string) { 1612 global $ b2_filter;1613 if (isset($ b2_filter['all'])) {1614 $ b2_filter['all'] = (is_string($b2_filter['all'])) ? array($b2_filter['all']) : $b2_filter['all'];1615 if (isset($ b2_filter[$tag]))1616 $ b2_filter[$tag] = array_merge($b2_filter['all'], $b2_filter[$tag]);1612 global $wp_filter; 1613 if (isset($wp_filter['all'])) { 1614 $wp_filter['all'] = (is_string($wp_filter['all'])) ? array($wp_filter['all']) : $wp_filter['all']; 1615 if (isset($wp_filter[$tag])) 1616 $wp_filter[$tag] = array_merge($wp_filter['all'], $wp_filter[$tag]); 1617 1617 else 1618 $ b2_filter[$tag] = array_merge($b2_filter['all'], array());1619 $ b2_filter[$tag] = array_unique($b2_filter[$tag]);1620 } 1621 if (isset($ b2_filter[$tag])) {1622 $ b2_filter[$tag] = (is_string($b2_filter[$tag])) ? array($b2_filter[$tag]) : $b2_filter[$tag];1623 $functions = $ b2_filter[$tag];1618 $wp_filter[$tag] = array_merge($wp_filter['all'], array()); 1619 $wp_filter[$tag] = array_unique($wp_filter[$tag]); 1620 } 1621 if (isset($wp_filter[$tag])) { 1622 $wp_filter[$tag] = (is_string($wp_filter[$tag])) ? array($wp_filter[$tag]) : $wp_filter[$tag]; 1623 $functions = $wp_filter[$tag]; 1624 1624 foreach($functions as $function) { 1625 1625 //error_log("apply_filters #1 applying filter $function"); … … 1631 1631 1632 1632 function add_filter($tag, $function_to_add) { 1633 global $ b2_filter;1634 if (isset($ b2_filter[$tag])) {1635 $functions = $ b2_filter[$tag];1633 global $wp_filter; 1634 if (isset($wp_filter[$tag])) { 1635 $functions = $wp_filter[$tag]; 1636 1636 if (is_array($functions)) { 1637 1637 foreach($functions as $function) { … … 1645 1645 if (is_array($function_to_add)) { 1646 1646 foreach($function_to_add as $function) { 1647 if (!in_array($function, $ b2_filter[$tag])) {1647 if (!in_array($function, $wp_filter[$tag])) { 1648 1648 $new_functions[] = $function; 1649 1649 } 1650 1650 } 1651 1651 } else */if (is_string($function_to_add)) { 1652 if (!@in_array($function_to_add, $ b2_filter[$tag])) {1652 if (!@in_array($function_to_add, $wp_filter[$tag])) { 1653 1653 $new_functions[] = $function_to_add; 1654 1654 } 1655 1655 } 1656 $ b2_filter[$tag] = $new_functions;1657 } else { 1658 $ b2_filter[$tag] = array($function_to_add);1656 $wp_filter[$tag] = $new_functions; 1657 } else { 1658 $wp_filter[$tag] = array($function_to_add); 1659 1659 } 1660 1660 return true; … … 1663 1663 // Check for hacks file if the option is enabled 1664 1664 if (get_settings('hack_file')) { 1665 if (file_exists( $abspath. '/my-hacks.php'))1666 require( $abspath. '/my-hacks.php');1665 if (file_exists(ABSPATH . '/my-hacks.php')) 1666 require(ABSPATH . '/my-hacks.php'); 1667 1667 } 1668 1668 ?>
Note: See TracChangeset
for help on using the changeset viewer.