WordPress.org

Make WordPress Core

Ticket #2866: wp-widgets-phantom-fix.diff

File wp-widgets-phantom-fix.diff, 1.2 KB (added by RuddO, 9 years ago)

Fix for WordPress widgets naivete

  • widgets.php

     
    194194        global $registered_widgets, $registered_sidebars, $registered_widget_controls; 
    195195 
    196196        if ( file_exists(dirname(__FILE__).'/scriptaculous/scriptaculous.js') ) 
    197                 $scriptdir = str_replace(ABSPATH, get_settings('siteurl').'/', dirname(__FILE__)) . '/scriptaculous'; 
     197                $scriptdir = get_settings('siteurl').'/wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/scriptaculous'; 
    198198        else 
    199199                $scriptdir = get_settings('siteurl') . '/wp-includes/js/scriptaculous'; 
    200200 
     
    939939                $title = "Unknown Feed"; 
    940940        $url = wp_specialchars(strip_tags($url), 1); 
    941941        if ( file_exists(dirname(__FILE__) . '/rss.png') ) 
    942                 $icon = str_replace(ABSPATH, get_settings('siteurl').'/', dirname(__FILE__)) . '/rss.png'; 
     942                $icon = get_settings('siteurl').'/wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/rss.png'; 
    943943        else 
    944944                $icon = get_settings('siteurl').'/wp-includes/images/rss.png'; 
    945945        $title = "<a class='rsswidget' href='$url' title='Syndicate this content'><img width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>";