]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/atomlib.php
WordPress 4.7
[autoinstalls/wordpress.git] / wp-includes / atomlib.php
index 271635fe45a8b13f7e4e67a93f8ee0bddd3d69dc..f2cba56361aaac15a45c5197f0cba3fdca568731 100644 (file)
@@ -121,6 +121,11 @@ class AtomParser {
 
         array_unshift($this->ns_contexts, array());
 
+        if ( ! function_exists( 'xml_parser_create_ns' ) ) {
+               trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
+               return false;
+        }
+
         $parser = xml_parser_create_ns();
         xml_set_object($parser, $this);
         xml_set_element_handler($parser, "start_element", "end_element");
@@ -159,7 +164,7 @@ class AtomParser {
 
     function start_element($parser, $name, $attrs) {
 
-        $tag = array_pop(split(":", $name));
+        $tag = array_pop(explode(":", $name));
 
         switch($name) {
             case $this->NS . ':feed':
@@ -238,7 +243,7 @@ class AtomParser {
 
     function end_element($parser, $name) {
 
-        $tag = array_pop(split(":", $name));
+        $tag = array_pop(explode(":", $name));
 
         $ccount = count($this->in_content);
 
@@ -313,7 +318,7 @@ class AtomParser {
 
     function ns_to_prefix($qname, $attr=false) {
         # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div')
-        $components = split(":", $qname);
+        $components = explode(":", $qname);
 
         # grab the last one (e.g 'div')
         $name = array_pop($components);