Bug #79320

ResourceCompressor treats protocol-relative URLs as local files

Added by Sacha Vorbeck over 2 years ago. Updated over 1 year ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2017-01-13
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

I`m just testing 8.5.1 and found out that config.compressJs =1 or config.concatentatJs = 1 crashes when using protocol-relative URLs like this:

page.includeJSLibs {
jquery = //code.jquery.com/jquery-2.2.2.min.js
jquery.external = 1
jquery.async = 1
jquery.forceOnTop = 1
jquery.allWrap = <!--[if lte IE 8]><script async="async" src="//code.jquery.com/jquery-1.12.2.min.js"></script><![endif]--><!--[if gt IE 8]><!-->|<!--<![endif]-->

Error message is: PHP Warning: file_get_contents(/Users/pp//web///code.jquery.com/jquery-2.2.2.min.js): failed to open stream: No such file or directory in /Users/pp/web/typo3_src-8.5.1/typo3/sysext/core/Classes/Resource/ResourceCompressor.php line 284

I think the //code.... URL is recognized as local file by the compressor (createMergedFile) and I`m pretty sure this worked on TYPO3 7.


Related issues

Related to TYPO3 Core - Task #75178: Use file_get_contents instead of getUrl() Closed 2016-03-18

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51318

#2 Updated by Georg Ringer over 2 years ago

  • Is Regression changed from No to Yes

See https://twitter.com/paul_irish/status/588502455530311680?lang=de: There is absolutly no reason to use protocol relative URLs if the resource is available with https!

nevertheless I fixed the bug

#3 Updated by Benni Mack about 2 years ago

  • Target version changed from 8 LTS to next-patchlevel

#4 Updated by Benni Mack over 1 year ago

  • Sprint Focus set to On Location Sprint

#5 Updated by Markus Klein over 1 year ago

  • Status changed from Under Review to Rejected
  • Target version deleted (next-patchlevel)
  • Is Regression deleted (Yes)

Using protocol relative paths does not make sense with having files concatenated by the server.
The server simply has no "protocol", it is the client against the external resource, hence it has to specify a schema.

Also available in: Atom PDF