Per documentation on PHP site
and
http://stackoverflow.com/questions/9050917/php-ltrim-behavior-with-chara...

    $css_paths[1] = parse_url(file_create_url($css_paths[0]));
    $css_paths[1] = ltrim($css_paths[1]['path'], $GLOBALS['base_path']);
    $js_paths[1] = parse_url(file_create_url($js_paths[0]));
    $js_paths[1] = ltrim($js_paths[1]['path'], $GLOBALS['base_path']);

if my base_path have the char list s and t
the end result of $css_path and $js_path will be incorrect

e.g.
sites/default/files/advagg_css
become
ites/default/files/advagg_css

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ckpoon’s picture

    $css_paths[1] = parse_url(file_create_url($css_paths[0]));
    if (substr($css_paths[1]['path'], 0, strlen($GLOBALS['base_path'])) == $GLOBALS['base_path']) {
        $css_paths[1] = substr($css_paths[1]['path'], strlen($GLOBALS['base_path']));
    }
    $js_paths[1] = parse_url(file_create_url($js_paths[0]));
    if (substr($js_paths[1]['path'], 0, strlen($GLOBALS['base_path'])) == $GLOBALS['base_path']) {
        $js_paths[1] = substr($js_paths[1]['path'], strlen($GLOBALS['base_path']));
    }
ckpoon’s picture

FileSize
1.19 KB
mikeytown2’s picture

Status: Active » Fixed
FileSize
4.65 KB

Following patch has been committed. Thanks for your help :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.