WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#7111 closed defect (bug) (fixed)

widgets.php in "/wp-admin/includes/" has no final PHP end tag

Reported by: scribblerguy Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: General Keywords: coding convention, end tags
Focuses: Cc:

Description

The "wp-admin/includes/widget.php" file (changeset 7979) does not have a final PHP end tag ("?>"). Is this on purpose? Or, if not, are there any functions that are missing?

http://trac.wordpress.org/browser/trunk/wp-admin/includes/widgets.php

The last 15 or so lines:

273     <?php
274 	    if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] )
275 	        echo $sidebar_args['after_widget'];
276 	    return $sidebar_args;
277 	}
278 	
279 	function wp_widget_control_ob_filter( $string ) {
280 	    if ( false === $beg = strpos( $string, '%BEG_OF_TITLE%' ) )
281 	        return '';
282 	    if ( false === $end = strpos( $string, '%END_OF_TITLE%' ) )
283 	        return '';
284 	    $string = substr( $string, $beg + 14 , $end - $beg - 14);
285 	    $string = str_replace( '&nbsp;', ' ', $string );
286 	    return trim( wp_specialchars( strip_tags( $string ) ) );
287 	}
288 	

That's it.

Compare:
http://trac.wordpress.org/browser/trunk/wp-admin/includes/widgets.php?rev=7978 (from changeset 7964)

Change History (4)

comment:1 @DD327 years ago

It is ok in PHP to leave off the final closing ?>, however, it does make it difficult for some people to tell the entire file is there..

comment:2 @Viper007Bond7 years ago

Plus it's not a file for users to edit, so best to have it there.

It was removed on accident anyway: [7979]

comment:3 @ryan7 years ago

  • Milestone changed from 2.5.2 to 2.6

comment:4 @ryan7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [8063]) Add php end tag. fixes #7111

Note: See TracTickets for help on using tickets.