Commit Graph

13061 Commits

Author SHA1 Message Date
Jakub Zalas
8882dad46e Remove an unused argument. 2014-03-31 22:49:46 +01:00
Fabien Potencier
b094ea7fe2 bug #10586 Fixes URL validator to accept single part urls (merk)
This PR was merged into the 2.3 branch.

Discussion
----------

Fixes URL validator to accept single part urls

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #3207 #6817
| License       | MIT
| Doc PR        | N/A

This PR replaces #6817 and has been rebased for 2.3, making a change to the regex to be simpler for single dot matches. (changing `([\pL\pN\pS-\.])+([\.]{0,1}[\pL]+[\.]{0,1})` to `([\pL\pN\pS-\.])+(\.?[\pL]+\.?)`)

Commits
-------

91e226e Fixes URL validator to accept single part urls
2014-03-31 13:10:34 +02:00
Fabien Potencier
3e678e7923 minor #10590 [2.3] Use Filesystem::chmod instead of chmod when dumping file (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] Use `Filesystem::chmod` instead of `chmod` when dumping file

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

This adds consistency as discussed in ca5eea5c19 (commitcomment-5804089)

Commits
-------

c2ffefd Use `Filesystem::chmod` instead of `chmod` when dumping file
2014-03-31 13:09:33 +02:00
Romain Neutron
c2ffefd0ef Use Filesystem::chmod instead of chmod when dumping file
This adds consistency as discussed in ca5eea5c19 (commitcomment-5804089)
2014-03-31 12:15:50 +02:00
Bernhard Schussek
ebfee723c9 [Form] Added test for disabling buttons 2014-03-31 11:59:54 +02:00
Adrià López Lozano
6bb355e2fd [Form] Added check for parent disabled status in Button form elements
The Button form element did not check for the parent disabled configuration status,
making them behave differently to all other form widgets.
2014-03-31 11:59:54 +02:00
Tim Nagel
91e226e06e Fixes URL validator to accept single part urls 2014-03-31 10:23:29 +11:00
Fabien Potencier
9e6af955f5 fixed float comparison in unit tests for HHVM 2014-03-30 09:33:31 +02:00
Fabien Potencier
8fbea0fe4d [Process] fixed HHVM usage on the CLI 2014-03-30 09:33:30 +02:00
Ioan Negulescu
dc0f8f9df8 Fix class names in ApcUniversalClassLoader tests. 2014-03-29 07:58:16 +01:00
Fabien Potencier
79540d4b6e fixed the profiler when an uncalled listener throws an exception when instantiated 2014-03-28 12:42:49 +01:00
Fabien Potencier
8a19b9ac08 fixed CS 2014-03-28 11:34:27 +01:00
Bernhard Schussek
18dc9a7f5f Added test case for 4c6a2d15095c13b2a35751b2b2712b183be489c4 2014-03-28 11:31:34 +01:00
Koen Kuipers
73d56f7a1a Fixed bug in ChoiceType triggering a warning when not using utf-8
This fixes issue #10409 by not using json_encode anymore, but serialize
instead.
2014-03-28 11:31:34 +01:00
Fabien Potencier
f4ffd95713 fixed CS 2014-03-27 19:14:33 +01:00
catch
cc9cc37e79 Avoid levenshtein comparison when using ContainerBuilder. 2014-03-27 19:13:32 +01:00
Fabien Potencier
47d1592b56 added missing unit test 2014-03-27 15:52:07 +01:00
Fabien Potencier
65b98102d1 fixed too greedy replacements 2014-03-27 10:14:18 +01:00
Fabien Potencier
d9cf28d016 fixed protocol-relative URLs 2014-03-27 10:14:18 +01:00
Luis Cordova
289da16681 added override power to server parameters provided on request method 2014-03-27 10:14:17 +01:00
Fabien Potencier
6dba2296f1 made parsing controllers more robust 2014-03-27 08:52:42 +01:00
John Nickell
fd1d48b54f Fixed YamlFileLoader imports path
YamlFileLoader used the resource name as the current directory during import, which can cause a failed import when using a relative path. Using the $path variable output from the locator is consistent with other loaders and fixes the bug.
2014-03-27 08:28:37 +01:00
Jerome TAMARELLE
97591c1b30 Check headers sent before sending PHP response
If the response contents has been sent before an error occurs, PHP
triggers the warning "Cannot modify header information - headers already sent"

This change ensure that the error message is echoed, while it's impossible
to change the HTTP status code and headers.
2014-03-26 19:06:50 +01:00
Diego Agulló
7a2f154533 Fixed ACE domain checks on UrlValidator (#10031) 2014-03-26 18:48:23 +01:00
Grégoire Paris
17ed8bf563 handle array root element
An array to string conversion notice was thrown when the root element of
the thing being validated is an array.
2014-03-26 18:31:52 +01:00
Romain Neutron
cefb67a340 Fix #8205 : Deprecate file mode update when calling dumpFile 2014-03-26 08:33:01 +01:00
Romain Neutron
8e3a3951e3 Fix #10437: Catch exceptions when reloading a no-cache request 2014-03-26 08:25:06 +01:00
Romain Neutron
489b8aea90 Fix libxml_use_internal_errors and libxml_disable_entity_loader usage 2014-03-26 08:21:50 +01:00
Michele Orselli
ecb6481117 removed ini check to make uploadedfile work on gae 2014-03-25 17:54:15 +01:00
Shady
79ceb094f0 Update OptionsResolver.php
Deleting an extra space in the exception.
2014-03-25 14:10:48 +01:00
Hugo Hamon
33c1ba7c79 fixed comment in forms.xml file 2014-03-24 19:01:48 +01:00
Sam Ward
e850b38464 Clean KernelInterface docblocks
- Fixed questionable grammar
- Added missing periods to make it consistent
2014-03-24 19:00:42 +01:00
Luiz “Felds” Liscia
d685d7d08b Cast the group name as a string
This allows the options to be grouped by association fields.
2014-03-21 12:48:42 +01:00
Kévin Dunglas
c5e8a884f8 Fixed doc of InitAclCommand 2014-03-19 21:51:09 +01:00
Fabien Potencier
fc251dbcd4 bug #10410 [Form] Fix "Array was modified outside object" in ResizeFormListener. (Chekote)
This PR was squashed before being merged into the 2.3 branch (closes #10410).

Discussion
----------

[Form] Fix "Array was modified outside object" in ResizeFormListener.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10405
| License       | MIT
| Doc PR        |

This is the second pull request for this issue. The history of this is as follows:

Original Fix was added Feb 11th under Pull Request #10232.
Users began complaining of Doctrine ArrayCollection not being updated in forms.
Revert was added Feb 15th under Pull Request #10269.
Issue #10405 was opened on 7th Mar for the original bug.

Pull Request #10269 has a failing test that illustrates users concerns.
I have added failing tests to this pull request to illustrate the problems described in #10405.

All tests now pass, and all forms of $data are now supported, including arrays, DoctrineCollection, ArrayObject, and other IteratorAggregates.

__Details as follows:__

The onSubmit() method of the ResizeFormListener class is assuming the data is an array, and calling unset directly inside a foreach. This works fine in most scenarios, but if data is an instance of IteratorAggregate that is iterating over $data by reference, it breaks with the following error:

Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener::onSubmit(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in ./vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php line 142

This is because the foreach loop is using an Iterator in the background, but the ResizeFormListener has unset the underlying data directly, causing the value that the Iterators internal pointer is pointing to to change.

The Iterator provided by IteratorAggregate may or may not have the ability to modify it's underlying data. So it is not possible to rely on the Iterator to modify the data. Instead, it is simpler to avoid modifying $data at all while we are iterating over it. So instead, we simply iterate over $data once to determine the keys we need to delete, and store them. Then we iterate over the keys and delete them from $data.

Commits
-------

aa63fae [Form] Fix "Array was modified outside object" in ResizeFormListener.
2014-03-19 17:44:48 +01:00
Chekote
aa63faea06 [Form] Fix "Array was modified outside object" in ResizeFormListener. 2014-03-19 17:44:48 +01:00
Fabien Potencier
65f024234d bug #10494 [2.3][Validator] Minor fix in IBAN validator (sprain)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Validator] Minor fix in IBAN validator

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10481, #10489
| License       | MIT

Added more values to unit tests of IBAN validator to make clear it doesn't accept lower case letters.

> Permitted IBAN characters are the digits 0 to 9 and the 26 upper-case Latin alphabetic characters A to Z.
http://en.wikipedia.org/wiki/International_Bank_Account_Number

Also made little adjustment to code which meant to validate lowercase letters but actually was useless.

Commits
-------

3eeb306 Fix IBAN validator
2014-03-19 17:10:10 +01:00
Manuel Reinhard
3eeb3067e3 Fix IBAN validator 2014-03-19 17:04:05 +01:00
Fabien Potencier
c29b4214b6 minor #10492 [2.3][Process] Remove unreachable code + avoid skipping tests in sigchild environment (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Remove unreachable code + avoid skipping tests in sigchild environment

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

As mentioned by @Tobion in https://github.com/symfony/symfony/pull/10480#issuecomment-38002910, I removed the dead code. I also fixed/updated the test suite on PHP compiled with `--enable-sigchild`.

Commits
-------

d52dd32 [Process] Remove unreachable code + avoid skipping tests in sigchild environment
2014-03-19 16:52:49 +01:00
Romain Neutron
d52dd32bad [Process] Remove unreachable code + avoid skipping tests in sigchild environment 2014-03-19 14:56:52 +01:00
Nick Stemerdink
861d3075b3 Fixed bug that incorrectly causes the "required" attribute to be omitted from select even though it contains the "multiple" attribute 2014-03-19 14:38:32 +01:00
Fabien Potencier
cc5f606356 minor #10484 [Process] fix some typos and refactor some code (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] fix some typos and refactor some code

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT

Commits
-------

b422613 [Process] fix some typos and refactor some code
2014-03-19 07:27:25 +01:00
Fabien Potencier
1e9e8afa5d bug #10479 [2.3][Process] Fix escaping on Windows (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Fix escaping on Windows

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Windows escaping is broken since the last merges.

After digging more on Windows escaping, I realised some things:
 - We forbid environment variable expansion by escaping `%APPDATA%` to `^%"APPDATA"^%`
 - We explicitly ask for variable expansion at runtime (running the command line with the [`/V:ON`](https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Process/Process.php#L235) flag). Running a command containing `!APPDATA!` will be escaped and expanded (our previous rule is easily overriden)
 - On platform that are not windows, we use strong escaping that prevents any variable expansion (`$PATH` will be escaped to `'$PATH'` that is not interpreted as the current PATH)

We have three possibilities:
 - Keep this behavior as this.
 - Prefer a consistent API and use a strong escaping strategy everywhere, but it would result in a BC break (see #8975).
 - Allow environment variable expansion and escape `%APPDATA%` to `"%APPDATA%"`

Any thoughts about this ?

Commits
-------

0f65f90 [Process] Fix escaping on Windows
2014-03-19 07:22:00 +01:00
Tobias Schultze
b4226137f6 [Process] fix some typos and refactor some code 2014-03-18 21:00:58 +01:00
Romain Neutron
5f6ee1205a [Process] Fix unit tests in sigchild disabled environment 2014-03-18 19:09:01 +01:00
Fabien Potencier
c57fbdad25 bug #10480 [Process] Fixed fatal errors in getOutput and getErrorOutput when process was not started (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Fixed fatal errors in getOutput and getErrorOutput when process was not started

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10022
| License       | MIT

This PR replaces #9452 and address the latest changes.
Side note : I've not updated `getExitCode`, `getExitCodeText` and `isSuccessful` as they were explicitly tested to return null in case the process is not started or terminated. I think it would be a BC break to do that.

Commits
-------

449fe01 [Process] Trow exceptions in case a Process method is supposed to be called after termination
0ae6858 [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started
2014-03-18 19:00:11 +01:00
Romain Neutron
449fe01992 [Process] Trow exceptions in case a Process method is supposed to be called after termination 2014-03-18 18:34:51 +01:00
Fabien Potencier
e4c4a7d538 fixed typo 2014-03-18 17:51:19 +01:00
Max Voloshin
0ae685878c [Process] fixed fatal errors in getOutput and getErrorOutput when process was not started 2014-03-18 15:14:03 +01:00
Romain Neutron
0f65f90b06 [Process] Fix escaping on Windows
Windows escaping is broken since the last merges.
2014-03-18 15:00:41 +01:00