Skip to content

Commit 4c2d155

Browse files
committed
minor #5321 Use the reserved domains example.com and example.org (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Use the reserved domains example.com and example.org | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | - Most of the current docs already use the reserved domains, but I think it's OK to add this recommendation to the docs standards. Commits ------- 3931faf Updated the list of reserved domains and the URL reference 62ce220 Use the reserved domains example.com and example.org
2 parents 59569c0 + 3931faf commit 4c2d155

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

contributing/documentation/standards.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ Code Examples
5757
Unless the example requires a custom bundle, make sure to always use the
5858
``AppBundle`` bundle to store your code;
5959
* Use ``Acme`` when the code requires a vendor name;
60+
* Use ``example.com`` as the domain of sample URLs and ``example.org`` and
61+
``example.net`` when additional domains are required. All of these domains are
62+
`reserved by the IANA`_.
6063
* To avoid horizontal scrolling on code blocks, we prefer to break a line
6164
correctly if it crosses the 85th character;
6265
* When you fold one or more lines of code, place ``...`` in a comment at the point
@@ -174,6 +177,7 @@ In addition, documentation follows these rules:
174177

175178
.. _`the Sphinx documentation`: http://sphinx-doc.org/rest.html#source-code
176179
.. _`Twig Coding Standards`: http://twig.sensiolabs.org/doc/coding_standards.html
180+
.. _`reserved by the IANA`: http://tools.ietf.org/html/rfc2606#section-3
177181
.. _`American English`: http://en.wikipedia.org/wiki/American_English
178182
.. _`American English Oxford Dictionary`: http://www.oxforddictionaries.com/definition/american_english/
179183
.. _`headings and titles`: http://en.wikipedia.org/wiki/Letter_case#Headings_and_publication_titles

reference/configuration/framework.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ respond and the user will receive a 500 response.
331331
332332
# app/config/config.yml
333333
framework:
334-
trusted_hosts: ['acme.com', 'acme.org']
334+
trusted_hosts: ['example.com', 'example.org']
335335
336336
.. code-block:: xml
337337
@@ -344,8 +344,8 @@ respond and the user will receive a 500 response.
344344
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
345345
346346
<framework:config>
347-
<trusted-host>acme.com</trusted-host>
348-
<trusted-host>acme.org</trusted-host>
347+
<trusted-host>example.com</trusted-host>
348+
<trusted-host>example.org</trusted-host>
349349
<!-- ... -->
350350
</framework>
351351
</container>
@@ -354,17 +354,17 @@ respond and the user will receive a 500 response.
354354
355355
// app/config/config.php
356356
$container->loadFromExtension('framework', array(
357-
'trusted_hosts' => array('acme.com', 'acme.org'),
357+
'trusted_hosts' => array('example.com', 'example.org'),
358358
));
359359
360-
Hosts can also be configured using regular expressions (e.g. ``.*\.?acme.com$``),
360+
Hosts can also be configured using regular expressions (e.g. ``.*\.?example.com$``),
361361
which make it easier to respond to any subdomain.
362362

363363
In addition, you can also set the trusted hosts in the front controller
364364
using the ``Request::setTrustedHosts()`` method::
365365

366366
// web/app.php
367-
Request::setTrustedHosts(array('.*\.?acme.com$', '.*\.?acme.org$'));
367+
Request::setTrustedHosts(array('.*\.?example.com$', '.*\.?example.org$'));
368368

369369
The default value for this option is an empty array, meaning that the application
370370
can respond to any given host.

0 commit comments

Comments
 (0)