oyejorge / less.php

less.js ported to PHP.
http://lessphp.typesettercms.com
Apache License 2.0
657 stars 2 forks source link

Halfling font of bootstrap not found anymore #342

Open UlrichKu opened 7 years ago

UlrichKu commented 7 years ago

Starting with version 1.7.0.11 the path for the font "Glyphicons Halflings" in bootstrap is generated with a '//' a the beginning if the variable $_SERVER['DOCUMENT_ROOT'] ends with a '/'.

The resulting https://assets/bootstrap/fonts/glyphicons-halflings-regular.woff is then not found and instead glyph codes displayed by the browser.

It seems to be only a problem of @font-face (with @font-face{ src: url('../fonts/glyphicons-halflings-regular.eot') })

The commit breaking this was: ae5b492a2d1d3bb6bba72f54bb4d55ef38d41608

A local workaround is to fix the document root before calling less: if ('/' === substr($_SERVER['DOCUMENT_ROOT'], -1)) { $_SERVER['DOCUMENT_ROOT'] = substr($_SERVER['DOCUMENT_ROOT'], 0, -1); }

Asenar commented 7 years ago

Hi,

what if DOCUMENT_ROOT does not exists (when you use command line for example) ?

Can you make a pull request to add tests/ for this ?

Also, an other workaround would be to define the correct path for @icon-font-path in variables.less