canton7 / canton7/fuelphp-casset
Remote assets beginning with // fail to load
- Dominant language
- PHP
- Stars
- 102
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
When loading remote assets using just `//` instead of `http(s)://` causes the following issue
```
ErrorException [ Warning ]: file_get_contents(//fonts.googleapis.com/css?family=Open+Sans:300,400,600): failed to open stream: No such file or directory
```
Adding the following code to `load_file()` resolves the problem.
```
if (strpos($filename, '//') === 0)
{
$protocol = \Input::server('https', false) ? 'https:' : 'http:';
$filename = $protocol.$filename;
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the load_file() entry point and reproduce the failure with the protocol-relative Google Fonts URL shown in the issue. Verify that protocol-relative remote assets load correctly under both HTTP and HTTPS, while ordinary asset URLs continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100