maikschneider / bw_icons

TYPO3 extensions that provides an icon picker for TCA and RTE.
GNU General Public License v2.0
1 stars 2 forks source link

"EXT:" gets detected as remote URL #58

Open benni3005 opened 4 weeks ago

benni3005 commented 4 weeks ago

Hi there,

a colleague of mine and I tried to use a locally available font from Icomoon by registering it this way:

mod.tx_bwicons {
  icomoon = Blueways\BwIcons\Provider\CssIconProvider
  icomoon {
    title = Portal Icon Font
    file = EXT:portal/Resources/Private/[...]/style.css
  }
}

Problem here is, that the CSssIconProvider uses this path correctly for reading and copying the stylesheet, but then downloading the fonts goes wrong, since the paths to the font files themself get detected as remote URLs. This happens here: https://github.com/maikschneider/bw_icons/blob/9d5eed422b5c71611d405f60575e1887886287e5/Classes/Provider/CssIconProvider.php#L286

I'm undecided if this is the right place to fix this bug, since GeneralUtility:isValidUrl() handles the EXT: part like an URL without complete scheme like mail: and it could be a bug in Typo3 itself, but I bet it's fixed faster here. If it helps: This only happened after refactoring the CssIconProvider and worked in version 2.1.x.

Greetings, Benni

maikschneider commented 4 weeks ago

Hi Benni, thanks for the feedback!

Oh, I never tried using an EXT: path for CSS files. I think this could be solved by applying a GeneralUtility::getFileAbsFileName() to the incoming file path.

I'll test it and will publish a fix very soon.