wp/wp-admin/link-parse-opml.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
--- a/wp/wp-admin/link-parse-opml.php	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-admin/link-parse-opml.php	Mon Oct 14 18:28:13 2019 +0200
@@ -6,8 +6,9 @@
  * @subpackage Administration
  */
 
-if ( ! defined('ABSPATH') )
+if ( ! defined( 'ABSPATH' ) ) {
 	die();
+}
 
 /**
  * @global string $opml
@@ -30,7 +31,7 @@
  * @param string $tagName XML element name.
  * @param array $attrs XML element attributes.
  */
-function startElement($parser, $tagName, $attrs) {
+function startElement( $parser, $tagName, $attrs ) {
 	global $names, $urls, $targets, $descriptions, $feeds;
 
 	if ( 'OUTLINE' === $tagName ) {
@@ -50,11 +51,11 @@
 		}
 
 		// Save the data away.
-		$names[] = $name;
-		$urls[] = $url;
-		$targets[] = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] :  '';
-		$feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] :  '';
-		$descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] :  '';
+		$names[]        = $name;
+		$urls[]         = $url;
+		$targets[]      = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : '';
+		$feeds[]        = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : '';
+		$descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : '';
 	} // End if outline.
 }
 
@@ -67,7 +68,7 @@
  * @param mixed $parser XML Parser resource.
  * @param string $tagName XML tag name.
  */
-function endElement($parser, $tagName) {
+function endElement( $parser, $tagName ) {
 	// Nothing to do.
 }
 
@@ -80,7 +81,7 @@
 $xml_parser = xml_parser_create();
 
 // Set the functions to handle opening and closing tags
-xml_set_element_handler($xml_parser, "startElement", "endElement");
+xml_set_element_handler( $xml_parser, 'startElement', 'endElement' );
 
 if ( ! xml_parse( $xml_parser, $opml, true ) ) {
 	printf(
@@ -92,4 +93,4 @@
 }
 
 // Free up memory used by the XML parser
-xml_parser_free($xml_parser);
+xml_parser_free( $xml_parser );