Opened 12 years ago
Closed 12 years ago
#20315 closed defect (bug) (invalid)
Remove unused code in media.php
Reported by: | arena | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | Embeds | Keywords: | close |
Focuses: | Cc: |
Description
linkifunknown variable is useless because always false when tested !
wp-includes/media.php:1029: var $linkifunknown = true; wp-includes/media.php:1276: $oldval = $this->linkifunknown; wp-includes/media.php:1277: $this->linkifunknown = false; wp-includes/media.php:1279: $this->linkifunknown = $oldval; wp-includes/media.php:1291: $output = ( $this->linkifunknown ) ? '<a href="' . esc_attr($url) . '">' . esc_html($url) . '</a>' : $url;
Change History (3)
Note: See
TracTickets for help on using
tickets.
It's not immediately clear what's going on, but it's definitely not dead code.
It's first declared as true:
var $linkifunknown = true;
Then a shortcode named 'embed' is added:
add_shortcode( 'embed', array(&$this, 'shortcode') );
In the
shortcode
method, amaybe_make_link
method is called, which uses$linkifunknown
. It's true here.$output = ( $this->linkifunknown ) ? '<a href="' . esc_attr($url) . '">' . esc_html($url) . '</a>' : $url;
$linkifunknown
is only false when called fromautoembed_callback
.When
shortcode
is called fromautoembed_callback
,$linkifunknown
is false.