bstrahija / assets-ci

Simple assets library for CodeIgniter. Ability to combine, minify and use the Less syntax.
http://creolab.hr
112 stars 30 forks source link

background image path 404 #29

Open umefarooq opened 12 years ago

umefarooq commented 12 years ago

Hi, i am using assets library but css background image path is not comming proper, my css image path is css/theme/default/d.png

see how it is coming


http://localhost/qahtan/application/themes/admin/assets/css/themes/default///localhost/qahtan/application/themes/admin/assets/css/themes/default///localhost/qahtan/application/themes/admin/assets/css/themes/default///localhost/qahtan/application/themes/admin/assets/css/themes/default/d.png

actual path is this
localhost/qahtan/application/themes/admin/assets/css/themes/default/d.png
facultymatt commented 11 years ago

Here is a temp fix untill i can offer a proper pull-request:

Around line 649 in assets.php library file, replace the line $new_href = with the following code

// check to make sure port still works when createing stylesheet url(), ie: localhost:8888
$port = !empty($base_parsed['port']) ? ':' . $base_parsed['port'] . '/' : '/';

$new_href = ((array_key_exists('scheme', $base_parsed)) ? $base_parsed['scheme'] . '://' . $base_parsed['host'] : "") . $port . implode("/", $parts);