WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (2 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/link-parse-opml.php

    r42201 r42343  
    77 */
    88
    9 if ( ! defined('ABSPATH') )
     9if ( ! defined( 'ABSPATH' ) ) {
    1010    die();
     11}
    1112
    1213/**
     
    3132 * @param array $attrs XML element attributes.
    3233 */
    33 function startElement($parser, $tagName, $attrs) {
     34function startElement( $parser, $tagName, $attrs ) {
    3435    global $names, $urls, $targets, $descriptions, $feeds;
    3536
     
    5152
    5253        // 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'] : '';
    5859    } // End if outline.
    5960}
     
    6869 * @param string $tagName XML tag name.
    6970 */
    70 function endElement($parser, $tagName) {
     71function endElement( $parser, $tagName ) {
    7172    // Nothing to do.
    7273}
     
    8182
    8283// Set the functions to handle opening and closing tags
    83 xml_set_element_handler($xml_parser, "startElement", "endElement");
     84xml_set_element_handler( $xml_parser, 'startElement', 'endElement' );
    8485
    8586if ( ! xml_parse( $xml_parser, $opml, true ) ) {
     
    9394
    9495// Free up memory used by the XML parser
    95 xml_parser_free($xml_parser);
     96xml_parser_free( $xml_parser );
Note: See TracChangeset for help on using the changeset viewer.