Before you ask please READ THIS

URL for layerslider .../borderlesslight3d/skin.css in generated incorrectly

edited October 2014 in Blame Posts: 11
Hi,

First, I'd like to say this is a great theme and far worth the money paid for it. It was choosen among almost one hundred different others.

The issue is: when a page has an layerslider animation, the generated URL for .../borderlesslight3d/skin.css is incorrect.

for some reason, my webserver physical folder address is being inserted in the middle of URL as shown in the picture below

image

My development web server root folder is: "D:\Portables\EasyPHP\data\localweb" and "atacado" is the name of my intranet site. BTW: "atacado" means wholesale in portuguese.

The correct address should be: http://127.0.0.1/atacado/wp-content/plugins/LayerSlider/static/skins/borderlesslight3d/skin.css

If you can send me a path, I can fix it by myself. Just need the:file, line and patched code.

thank you
bug-layerslider-borderlesslight3d.png
1004 x 151 - 39K

Comments

  • edited October 2014 Posts: 11
    Improving the feedback: In the generated html, there's this snippet:

    .... skinsPath: 'http://127.0.0.1/atacado/wp-contentD:\Portables\EasyPHP\data\localweb\atacado\wp-content\plugins\LayerSlider/static/skins/'}) }.....

    Post edited by margenn on
  • AirAir
    edited October 2014 Posts: 10,970
    Hello:-)

    Thanks for all kindness and all "side" informations :-)

    It looks like it might be problem in LayerSlider, however such issues(path rewrites) usually disappear on public servers.

    I have no idea what should be patched as this is part of external plugin. However I will google about it and dig around, and maybe I will find something suspicious in their code.

    Did you make any modifications that could alter this path?

    PS. If you are happy with this theme please don't forget to rate us on ThemeForest - it helps us a lot! Thanks! How to rate?

    With regards.
    Post edited by Air on
  • Posts: 11

    I've found the solution for the problem above:

    In file: class.ls.sources.php line 129
    Replace this line: return WP_CONTENT_URL. str_replace(WP_CONTENT_DIR, '', $path).'/';
    By this: return WP_CONTENT_URL. str_replace(str_replace('\\', '/', WP_CONTENT_DIR), '', str_replace('\\', '/', $path)).'/';

    Reason: In Windows we have the problem of backslashes.

    Example taken from my debug session:
    WP_CONTENT_DIR = D:\Portables\EasyPHP\data\localweb\atacado/wp-content
    $path = D:\Portables\EasyPHP\data\localweb\atacado\wp-content\plugins\LayerSlider/static/skins/borderlesslight3d

    The purpose of str_replace on line 129 is removing the absolute path, leaving just the relative part of it. In other words, leaving only the path that comes after "...wp-content".
    The problem is: In windows you have BackSlashes and ForwardSlashes mixed in everything. 
    "WP_CONTENT_DIR" do not match with the begin of "$path". Due this, the whole content of "$path" is concatenated after WP_CONTENT_URL, causing de bug. The workaround is just replacing BackSlashes of the "needle" and the "haystack" before apply the str_replace.

    Cheers

  • AirAir
    Posts: 10,970
    Hi there:-)

    Thanks for detailed info. That is why I said that such problem usually
    disappear on public servers.

    Great that you have solved this.

    With regards.
  • edited October 2014 Posts: 11
    I'm in a intranet environment, so unfortunately my public server still is a windows box... and the "official" browser over here still is the crappy IE8... So I don't have other option but solving this.. thanks anyway
    Post edited by margenn on
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!