Ticket #9561: 9561.diff
File 9561.diff, 2.0 KB (added by , 16 years ago) |
---|
-
Users/denis/Sites/sem-pro/wp-includes/plugin.php
492 492 $file = preg_replace('|/+|','/', $file); // remove any duplicate slash 493 493 $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs 494 494 $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash 495 $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir 495 $mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs 496 $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash 497 $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir 496 498 return $file; 497 499 } 498 500 -
Users/denis/Sites/sem-pro/wp-includes/link-template.php
1752 1752 */ 1753 1753 function plugins_url($path = '', $plugin = '') { 1754 1754 $scheme = ( is_ssl() ? 'https' : 'http' ); 1755 $url = WP_PLUGIN_URL; 1755 1756 if ( $plugin !== '' && preg_match('#^' . preg_quote(WPMU_PLUGIN_DIR . DIRECTORY_SEPARATOR, '#') . '#', $plugin) ) { 1757 $url = WPMU_PLUGIN_URL; 1758 } else { 1759 $url = WP_PLUGIN_URL; 1760 } 1761 1756 1762 if ( 0 === strpos($url, 'http') ) { 1757 1763 if ( is_ssl() ) 1758 1764 $url = str_replace( 'http://', "{$scheme}://", $url ); 1759 1765 } 1760 1761 if ( !empty($plugin) && is_string($plugin) ) 1762 { 1766 1767 if ( !empty($plugin) && is_string($plugin) ) { 1763 1768 $folder = dirname(plugin_basename($plugin)); 1764 1769 if ('.' != $folder) 1765 1770 $url .= '/' . ltrim($folder, '/'); 1766 1771 } 1767 1772 1768 1773 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 1769 1774 $url .= '/' . ltrim($path, '/'); 1770 1775