Changeset 42343 for trunk/src/wp-admin/link-parse-opml.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/link-parse-opml.php
r42201 r42343 7 7 */ 8 8 9 if ( ! defined( 'ABSPATH') )9 if ( ! defined( 'ABSPATH' ) ) { 10 10 die(); 11 } 11 12 12 13 /** … … 31 32 * @param array $attrs XML element attributes. 32 33 */ 33 function startElement( $parser, $tagName, $attrs) {34 function startElement( $parser, $tagName, $attrs ) { 34 35 global $names, $urls, $targets, $descriptions, $feeds; 35 36 … … 51 52 52 53 // Save the data away. 53 $names[] = $name;54 $urls[] = $url;55 $targets[] = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] :'';56 $feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] :'';57 $descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : 54 $names[] = $name; 55 $urls[] = $url; 56 $targets[] = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : ''; 57 $feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : ''; 58 $descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : ''; 58 59 } // End if outline. 59 60 } … … 68 69 * @param string $tagName XML tag name. 69 70 */ 70 function endElement( $parser, $tagName) {71 function endElement( $parser, $tagName ) { 71 72 // Nothing to do. 72 73 } … … 81 82 82 83 // Set the functions to handle opening and closing tags 83 xml_set_element_handler( $xml_parser, "startElement", "endElement");84 xml_set_element_handler( $xml_parser, 'startElement', 'endElement' ); 84 85 85 86 if ( ! xml_parse( $xml_parser, $opml, true ) ) { … … 93 94 94 95 // Free up memory used by the XML parser 95 xml_parser_free( $xml_parser);96 xml_parser_free( $xml_parser );
Note: See TracChangeset
for help on using the changeset viewer.