Author Topic: Bug, output_filter, WB 2.8.2RC2  (Read 1905 times)

Offline Xagone

  • Posts: 482
  • Gender: Male
  • Developper
    • Xagone Inc
Bug, output_filter, WB 2.8.2RC2
« on: December 22, 2011, 10:21:46 PM »
when loading a template, you see a js file called that is not linked right

something like
<script src="/home/user/website/js/mdcr.js" type="text/javascript"></script>

it's because of line 116 throught in filter-routine.php in output-filter module.

this code does not work :
Code: [Select]
$script = str_replace('\\', '/', dirname(__FILE__)).'/js/mdcr.js';
if(is_readable($script)) {
$scriptLink = '<script src="'.$script.'" type="text/javascript"></script>';
$regex = '/(.*)(<\s*?\/\s*?head\s*>.*)/isU';
$replace = '$1'.$scriptLink.'$2';
$content = preg_replace ($regex, $replace, $content);
$output_filter_mode |= pow(2, 2); // n | 2^2
}

so to "repair" the problem, i've added the line
Code: [Select]
$script = str_replace(dirname(__FILE__),WB_URL.'/modules/output_filter',$script);right after
Code: [Select]
if(is_readable($script)) {witch gives
Code: [Select]
$script = str_replace('\\', '/', dirname(__FILE__)).'/js/mdcr.js';
if(is_readable($script)) {
$script = str_replace(dirname(__FILE__),WB_URL.'/modules/output_filter',$script);
$scriptLink = '<script src="'.$script.'" type="text/javascript"></script>';
$regex = '/(.*)(<\s*?\/\s*?head\s*>.*)/isU';
$replace = '$1'.$scriptLink.'$2';
$content = preg_replace ($regex, $replace, $content);
$output_filter_mode |= pow(2, 2); // n | 2^2
}
Xagone Inc. (formerly VotreEspace)
http://xagone.com/

 

postern-length