This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier c669b88403 bug #22528 [Asset] Starting slash should indicate no basePath wanted (weaverryan)
This PR was squashed before being merged into the 2.7 branch (closes #22528).

Discussion
----------

[Asset] Starting slash should indicate no basePath wanted

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes-ish... and no-ish
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

**Important** View the second commit for an accurate diff. The first commit just renames some strings in a test for clarity.

When we moved `PathPackage` from `Templating` to `Asset`, we actually changed its behavior. Assume that we're deployed under a `/subdir` subdirectory:

**Before** `{{ asset('/main.css') }}` would *not* have the base path prefixed -> `/main.css`

**After** `{{ asset('/main.css') }}` *does* have the base path prefixed -> `/subdir/main.css`

3adff11d72/src/Symfony/Component/Templating/Asset/PathPackage.php (L61-L63)

This PR simply reverses that, to the *previous* behavior. This *is* a BC break... and also arguably a bug fix :). Interestingly, when we changed the behavior the first time (i.e. broke BC), I don't think that anyone noticed. It should only affect users deployed under a subdirectory.

Why do I care? I'm using the new `JsonManifestVersionStrategy` with a library that is outputting paths that *already* include my subdirectory:

```json
{
    "build/main.css": "/subdir/build/main.abc123.css"
}
```

So, I do not want Symfony to detect the `/subdir` and apply it a second time.

Commits
-------

3cc096b540 [Asset] Starting slash should indicate no basePath wanted
2017-04-28 16:08:26 -07:00
.composer Drop hirak/prestissimo 2016-05-12 07:44:15 -05:00
.github [github] Add a reminder about CHANGELOG.md files 2017-03-06 21:03:23 +01:00
src/Symfony bug #22528 [Asset] Starting slash should indicate no basePath wanted (weaverryan) 2017-04-28 16:08:26 -07:00
.editorconfig Add EditorConfig File 2012-06-16 14:08:15 +02:00
.gitignore Add appveyor.yml for C.I. on Windows 2015-08-25 23:41:37 +02:00
.php_cs.dist fixed CS 2017-01-21 08:52:33 -08:00
.travis.yml Make .travis.yml more readable 2017-04-19 14:51:17 +02:00
appveyor.yml Lighten tests output by removing composer suggestions 2017-04-03 11:45:38 +02:00
CHANGELOG-2.2.md Merge branch '2.2' into 2.3 2013-12-03 15:51:26 +01:00
CHANGELOG-2.3.md updated CHANGELOG for 2.3.42 2016-05-30 10:40:50 +02:00
CHANGELOG-2.4.md updated CHANGELOG for 2.4.9 2014-09-03 11:50:09 +02:00
CHANGELOG-2.5.md updated CHANGELOG for 2.5.10 2015-02-02 10:26:02 +01:00
CHANGELOG-2.6.md updated CHANGELOG for 2.6.10 2015-07-13 11:34:21 +02:00
CHANGELOG-2.7.md updated CHANGELOG for 2.7.26 2017-04-03 21:27:56 -07:00
composer.json move conflict section of composer.json 2017-02-18 18:36:41 +01:00
CONTRIBUTING.md Mention the community review guide 2016-12-18 22:02:35 +01:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.7.26 2017-04-03 21:31:39 -07:00
LICENSE updated LICENSE year 2017-01-02 12:30:00 -08:00
phpunit Use PHPUnit 6.0 on PHP 7.* test lines 2017-02-21 14:43:45 +01:00
phpunit.xml.dist fail when detecting risky tests 2017-04-12 09:39:27 +02:00
README.md Fix minor typo in the main README.md 2017-04-27 20:23:38 +02:00
UPGRADE-2.1.md Remove aligned '=>' and '=' 2014-10-26 08:30:58 +01:00
UPGRADE-2.2.md Merge branch '2.3' into 2.5 2014-10-01 07:50:18 +02:00
UPGRADE-2.3.md [Doc] Use Markdown syntax highlighting 2014-10-01 07:38:33 +02:00
UPGRADE-2.4.md Updated UPGRADE-2.4.md 2015-06-08 16:44:57 +02:00
UPGRADE-2.5.md Merge branch '2.5' into 2.6 2015-01-05 21:59:13 +01:00
UPGRADE-2.6.md Fix grammar 2014-12-30 09:24:50 +01:00
UPGRADE-2.7.md Update UPGRADE-2.7.md 2016-11-07 10:23:54 +03:00
UPGRADE-3.0.md Add missing pieces in the upgrade guide to 3.0 2017-01-27 15:42:16 +01:00

Symfony is a PHP framework for web applications and a set of reusable PHP components. Symfony is used by thousands of web applications (including BlaBlaCar.com and Spotify.com) and most of the popular PHP projects (including Drupal and Magento).

Installation

Documentation

Community

Contributing

Symfony is an Open Source, community-driven project with thousands of contributors. Join them contributing code or contributing documentation.

Security Issues

If you discover a security vulnerability within Symfony, please follow our disclosure procedure.

About Us

Symfony development is sponsored by SensioLabs, led by the Symfony Core Team and supported by Symfony contributors.