Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jul 17, 2015
2 parents befbf7b + 90745db commit 3b829c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cookbook/assetic/php.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ First, configure a new ``scssphp`` Assetic filter:
The value of the ``formatter`` option is the fully qualified class name of the
formatter used by the filter to produce the compiled CSS file. Using the
compressed formatter will minimize the the resulting file, regardless of whether
compressed formatter will minimize the resulting file, regardless of whether
the original files are regular CSS files or SCSS files.

Next, update your Twig template to add the ``{% stylesheets %}`` tag defined
Expand Down
12 changes: 6 additions & 6 deletions cookbook/controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ There are some important things to consider in the code of the above controller:
provides methods for the most common operations when dealing with uploaded files.
#. A well-known security best practice is to never trust the input provided by
users. This also applies to the files uploaded by your visitors. The ``Uploaded``
class provides methods to get the original file extension (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getExtension()`),
the original file size (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getSize()`)
and the original file name (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientOriginalName()`).
class provides methods to get the original file extension (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getExtension`),
the original file size (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getSize`)
and the original file name (:method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::getClientOriginalName`).
However, they are considered *not safe* because a malicious user could tamper
that information. That's why it's always better to generate a unique name and
use the :method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::guessExtension()`
use the :method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::guessExtension`
method to let Symfony guess the right extension according to the file MIME type.
#. The ``UploadedFile`` class also provides a :method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::move()`
#. The ``UploadedFile`` class also provides a :method:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile::move`
method to store the file in its intended directory. Defining this directory
path as an application configuration option is considered a good practice that
simplifies the code: ``$this->container->getParameter('brochures_dir')``.
Expand All @@ -172,6 +172,6 @@ You can now use the following code to link to the PDF brochure of an product:

.. code-block:: html+jinja

<a href="{{ asset('uploads/brochures' ~ product.brochure) }}">View brochure (PDF)</a>
<a href="{{ asset('uploads/brochures/' ~ product.brochure) }}">View brochure (PDF)</a>

.. _`VichUploaderBundle`: https://github.com/dustin10/VichUploaderBundle
2 changes: 1 addition & 1 deletion cookbook/email/email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ template might look something like this:
{# app/Resources/views/Emails/registration.html.twig #}
<h3>You did it! You registered!</h3>

{# example, assuming you have a route named "login" $}
{# example, assuming you have a route named "login" #}
To login, go to: <a href="{{ url('login') }}">...</a>.

Thanks!
Expand Down

0 comments on commit 3b829c0

Please sign in to comment.