Commit Graph

6089 Commits

Author SHA1 Message Date
Fabien Potencier
b7fd5198ec [Security] fixed cast 2011-12-07 20:44:38 +01:00
Fabien Potencier
acbbe8ac7f [Process] introduced usage of PHP_BINARY (available as of PHP 5.4) 2011-12-07 19:32:30 +01:00
Fabien Potencier
43a6aa9db2 merged branch Seldaek/cookiefix (PR #2698)
Commits
-------

e06cea9 [HttpFoundation] Cookie values should not be restricted

Discussion
----------

[HttpFoundation] Cookie values should not be restricted

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

The restriction I removed makes no sense IMO because we do not use setrawcookie() to send cookies. setrawcookie() does throw a warning when the cookie value contains incorrect characters, but not setcookie(). The latter will just urlencode() the value so it becomes valid. This is also what is done by `Cookie::__toString`, so this could be used in combination with header() to just send raw cookies that are valid, even with values that are invalid in their decoded form.

PHP urldecodes cookies on input, so it all works fine.
2011-12-07 16:37:58 +01:00
meze
03ed770d35 [Validator] The current class isn't set in execution context when doing validateProperty() 2011-12-07 16:20:32 +01:00
Fabien Potencier
48b084eb85 fixed typo 2011-12-03 09:00:15 +01:00
Hugo Hamon
240796e9f3 [Bridge] [Doctrine] fixed coding conventions. 2011-12-02 23:11:12 +01:00
Matt Lehner
7cfc3923b6 check for session before trying to authentication details 2011-12-02 13:32:26 +01:00
Fabien Potencier
648fae7746 merged branch proofek/domcrawlerform-radiodisabled (PR #2768)
Commits
-------

36c7d03 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

Discussion
----------

Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: - GH-2720

I wasn't really sure about the correct approach. This one is very minimalistic and following the existing concept of not duplicating nodes of the same name, but only storing multiple values for the same node. If you think that should be changed, let me know. Hints appreciated.

Thanks
2011-12-02 13:26:19 +01:00
Fabien Potencier
3976b7a5ee [DoctrineBridge] fixed CS 2011-12-02 13:16:59 +01:00
Benjamin Eberlei
3c83b89c5e [DoctrineBridge] Catch user-error when the identifier is not serialized with the User entity. 2011-12-01 20:17:08 +01:00
Hugo Hamon
5e5050db53 [FrameworkBundle] fixed unescaped file_link_format parameter in CodeHelper that made the functional tests fail when checking a 4xx page. The generated file link format used in an HTML stack trace didn't contain an escaped ampersand (&) character. The resulting HTML code was not validable against its DTD and so the Crawler made the tests fail when checking a 4xx page. 2011-12-01 10:53:50 +01:00
Fabien Potencier
83894be6c8 merged branch pcampr/cs_translation_fix (PR #2737)
Commits
-------

0be8820 [FrameworkBundle] fixed small typo in Czech translation

Discussion
----------

[FrameworkBundle] fixed small typo in Czech translation

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

fixed small typo in Czech translation in validators.cs.xliff
2011-12-01 08:53:13 +01:00
Fabien Potencier
cc66739f3d merged branch DavidChristmann/fix_gen_entities_namespace (PR #2746)
Commits
-------

4a8f101b Fixed problem with multiple occurences of a given namespace. fix #2688

Discussion
----------

[Console] [Doctrine] Fixed: Entities are generated in wrong folder (doctrine:generate:entities Namespace)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no
Fixes the following tickets: 2688
Todo: -

Bug-description:
In our project we have some bundles from the same root-namespace "ABC" stored under "vendors/bundles/ABC" and some bundles under "src/ABC".

Running the command "$php app/console doctrine:generate:entities ABC" from the commandline generates the entities from "src/ABC/" under "vendors/bundles/ABC/" or vice versa depending on their order in the bundle array in the Appkernel.php.

The error does not occur when the entities are generated by bundlename or by classname.

Bugfix:-description:
Bugfix was to get the path for each entity class once more before generating the entities. Before the bugfix the path was taken form the first entity class of the namespace without checking if the following entities have a different path.
2011-12-01 08:48:29 +01:00
Fabien Potencier
654352f8d1 merged branch pscheit/master (PR #2742)
Commits
-------

63e2a99 [CssSelector] Fixed Issue for XPathExprOr: missing prefix in string conversion

Discussion
----------

[CssSelector] Issue for XPathExprOr: missing prefix in string conversion

Hi there,

I created a small and dumb test for the issue. I looked at the original implementation and i think the problem is, that private properties are used in the parent class for xPathExprOr. so that the prefix cannot be accessd with $this->prefix in XPathExprOr
However I think the distribution for the prefix should be put in the parts of the or-sub-expressions the way it is shown in the test.

Hope this helps.

Best regards
Philipp
2011-12-01 08:46:19 +01:00
Dariusz Górecki
769c17bb95 Throw exceptions in case someone forgot to set method name in call.
Bug fix: yes
Feature add: no
Symfony2 tests pass: yes
Symfony2 tests added: yes

In general without this exception generated by php dumper container class, will cause PHP fatal error, bacause method call will look like this: `$instance->(/* arguments*/);`.
2011-11-30 15:59:17 +01:00
David Christmann
4a8f101b9d Fixed problem with multiple occurences of a given namespace. fix #2688 2011-11-29 10:03:39 +01:00
pscheit
63e2a993eb [CssSelector] Fixed Issue for XPathExprOr: missing prefix in string conversion 2011-11-28 22:00:26 +01:00
Pavel Campr
0be8820d9d [FrameworkBundle] fixed small typo in Czech translation 2011-11-27 20:15:26 +01:00
Sebastian Marek
36c7d03040 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements 2011-11-26 14:07:00 +00:00
Francis Besset
17dc605ca0 [FrameworkBundle] Checks that the template is readable before checking its modification time 2011-11-26 13:28:35 +01:00
Fabien Potencier
7b1dda84b9 [HttpKernel] added unit tests for previous merge 2011-11-24 08:39:49 +01:00
Juan M Martínez
61e0bdebf8 [HttpKernel] ControllerResolver arguments reflection for Closure object.
When controller is a Closure ControllerResolver::getArguments tries to
make a ReflectionMethod of the __invoke method. But because it's an
internal function, the parameters method isDefaultValueAvailable will
return always false, even if isOptional return true.
2011-11-24 08:39:37 +01:00
Fabien Potencier
5878490b16 removed unused use statements 2011-11-24 07:16:14 +01:00
Jordi Boggiano
ca974f5b4d Fix doctrine requirement 2011-11-23 18:24:40 +01:00
Jordi Boggiano
c76487ee04 Fix composer.json files to be stricter 2011-11-23 17:51:23 +01:00
Jordi Boggiano
a5a867599e Fix requirement name 2011-11-23 16:04:15 +01:00
Jordi Boggiano
e06cea9aaa [HttpFoundation] Cookie values should not be restricted 2011-11-23 11:38:46 +01:00
Fabien Potencier
286ce0ea40 merged branch pulzarraider/proxy_ip_fix (PR #2695)
Commits
-------

11b6156 updated unittest
a931e21 get correct client IP from X-forwarded-for header

Discussion
----------

[HttpFoundation] Get correct client IP when using trusted proxy (Varnish)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
Note: This is reopened PR #2686 for 2.0 branch.

If using trusted proxy (Varnish, ...) the client IP must be identified from X-Forwarded-For header. The header has de-facto standard format:

X-Forwarded-For : client1, proxy1, proxy2,

where the value is a comma+space separated list of IP addresses, the left-most being the farthest downstream client, and each successive proxy that passed the request adding the IP address where it received the request from. See: http://en.wikipedia.org/wiki/X-Forwarded-For

Function getClientIp should return only one client IP, not a list of all nonimportant IPs as it's now. Similar example can be seen in Cake framework: http://api.cakephp.org/view_source/request-handler-component/#line-477

There are many ways how to chose the first IP from X-Forwarded-For header. Any other faster and more reliable way is welcome.
2011-11-23 11:22:06 +01:00
Andrej Hudec
a931e21284 get correct client IP from X-forwarded-for header 2011-11-22 22:01:07 +01:00
Fabien Potencier
60f8525ae5 merged branch lsmith77/forward_compat (PR #2526)
Commits
-------

b6bf018 tweaked error handling for the forward compatibility
dd606b5 added note about the purpose of this class
c1426ba added locale handling forward compatibility
10eed30 added MessageDataCollector forward compatibility

Discussion
----------

Forward compat

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2522
2011-11-22 19:39:27 +01:00
Fabien Potencier
bb025bb904 merged branch hlecorche/valid-form-w3c (PR #2676)
Commits
-------

78e9b2f [Form] Fixed textarea_widget (W3C standards)

Discussion
----------

[Form] Fixed textarea_widget (W3C standards)

Textarea widget included the "pattern" attribute but is not valid by W3C standards.

(See PR 2666 - New PR because rebase inside the 2.0 branch)

---------------------------------------------------------------------------

by fabpot at 2011/11/18 09:01:41 -0800

@hlecorche: Thanks for your work on this issue. Can you update the unit tests to be sure that this case is covered? If you're not comfortable with this, just tell me and I will do it myself

---------------------------------------------------------------------------

by hlecorche at 2011/11/19 02:51:06 -0800

@fabpot: I did'nt commited because I am not sure. I changed the "tests/Symfony/Tests/Component/Form/AbstractLayoutTest.php" file :

    public function testTextarea()
    {
        $form = $this->factory->createNamed('textarea', 'na&me', 'foo&bar', array(
            'property_path' => 'name',
            'pattern' => 'foo',
        ));

        $this->assertWidgetMatchesXpath($form->createView(), array(),
    '/textarea
    [@name="na&me"]
    [not(@pattern)]
    [.="foo&bar"]
    '
        );
    }

Is it correct?
2011-11-22 10:25:58 +01:00
Fabien Potencier
48c0f50fa2 [Form] tweaked an exception message 2011-11-22 10:24:03 +01:00
Fabien Potencier
af2713261d merged branch canni/throw_exception_on_form_name_circulal_ref (PR #2675)
Commits
-------

36cebf0 Fix infinite loop on circullar reference in form factory

Discussion
----------

[BugFix][Form]Throw exception on form name circulal ref

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Closes: #2673

When FormType method `getName()` returns the same value as `getParent()` we're asking about trouble, and land into infinite loop.
2011-11-22 10:21:50 +01:00
Fabien Potencier
7c8d836331 merged branch willdurand/undefined-value-property-path (PR #2266)
Commits
-------

57e1aeb Fixed undefined index notice in readProperty() method (PropertyPath)

Discussion
----------

Fixed undefined index notice in readProperty() method (PropertyPath)

Hi,

For some reasons, I get `notice` errors on `readProperty()` with Propel:

    Notice: Undefined index: 0 in /Users/william/projects/Propel/testProjects/symfony2/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php line 284

The `PropelObjectCollection` implements `ArrayAccess`, the `readProperty()` method does not check if the given `index` exists so the `notice` error is thrown. I suppose to check whether the index exists or not has to be added.

Regards,
William

---------------------------------------------------------------------------

by fabpot at 2011/09/27 23:42:07 -0700

The patch is probably not what we want to do. First, I suppose that you are not creating the propertyPath by hand. If that is the case, we need to understand why the property path does not exist. Then, even if we might want to check the existence of the index, if it does not exist, we should probably throw an exception instead of just ignoring the problem.

---------------------------------------------------------------------------

by willdurand at 2011/09/28 01:14:49 -0700

My bad. This is a Propel bug due to `ArrayObject`. It throws a notice error if the index is not found in `offsetGet()` which is wrong according to the `ArrayAccess` interface. If the index is not found, we have to return `null`.

@fabpot Are you agree with that (for the `null` value) ?

---------------------------------------------------------------------------

by fabpot at 2011/09/28 01:17:09 -0700

My point is that it should never happen under normal circumstances.

---------------------------------------------------------------------------

by willdurand at 2011/09/28 01:23:55 -0700

@fabpot Not sure to get it.

The fact is that it tries to get the value (`getValue()`) of a fresh object, just added to the `collection` when I'm submitting a form with a `CollectionType` and a new entry in it.
I mean it tries to get this new object (not yet persisted, not yet in the collection) in the collection (`getValue()` -> `readProperty()`) which implements `ArrayAccess` but this object cannot be in the collection at this time.

Am I wrong ?

And, without this notice error thrown by Propel, I probably never opened this issue...

---------------------------------------------------------------------------

by willdurand at 2011/09/29 06:40:34 -0700

@fabpot: you can try this example: http://www.propelorm.org/cookbook/symfony2/mastering-symfony2-forms-with-propel.html#manytomany_relations in order to make your own tests. Will it be enough?
As I said, it throws a weird notice for the reasons above.

---------------------------------------------------------------------------

by jaugustin at 2011/10/04 12:58:10 -0700

any news on this ?
@fabpot did you have time to look at the test case ?

---------------------------------------------------------------------------

by cedriclombardot at 2011/11/09 14:29:42 -0800

@fabpot: can we have news about this ?
2011-11-22 09:55:47 +01:00
pborreli
1fb90397c4 [FrameworkBundle] Skipping one test failing on PHP5.3.2 2011-11-22 07:40:01 +01:00
ondrowan
1dcf74ab70 Fixed small typo in phpdoc. 2011-11-21 21:11:59 +01:00
Fabien Potencier
d4f1721336 [Swiftmailer] fixed composer.json 2011-11-18 17:32:56 +01:00
hlecorche
78e9b2fedb [Form] Fixed textarea_widget (W3C standards) 2011-11-18 17:31:57 +01:00
Dariusz Górecki
36cebf0924 Fix infinite loop on circullar reference in form factory
When `->getName()` returns the same as `getParent()` we're going to infinite loop.
2011-11-18 14:23:22 +01:00
Fabien Potencier
12299c4de9 merged branch kriswallsmith/form/checkbox-view (PR #2661)
Commits
-------

79ae3fc [Form] fixed radio and checkbox when data is not bool

Discussion
----------

[Form] fixed checkbox view

The checkbox view was being built based on app data, not client data. This fixes it.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

---------------------------------------------------------------------------

by fabpot at 2011/11/16 13:31:09 -0800

`RadioType` suffers from the same problem, no?

---------------------------------------------------------------------------

by kriswallsmith at 2011/11/16 13:32:50 -0800

Yeah, I'll fix that too.

---------------------------------------------------------------------------

by kriswallsmith at 2011/11/16 13:43:29 -0800

Updated to include `RadioType`.
2011-11-17 07:05:47 +01:00
Fabien Potencier
d1ae6c7cb6 bumped Symfony version in composer.json files to 2.0.7 2011-11-17 06:58:47 +01:00
Fabien Potencier
3ef8079b50 bumped Symfony version to 2.0.7-DEV 2011-11-17 06:58:18 +01:00
Kris Wallsmith
79ae3fced9 [Form] fixed radio and checkbox when data is not bool 2011-11-16 13:39:36 -08:00
Fabien Potencier
b55a43813e updated VERSION for 2.0.6 2011-11-16 20:35:49 +01:00
Fabien Potencier
7af5f598d9 merged branch tacker/2.0 (PR #2641)
Commits
-------

8399574 Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition()

Discussion
----------

Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition()

Have setDefinition() accept InputDefinition instead of Definition.
2011-11-15 07:59:56 +01:00
Fabien Potencier
262bf54d51 merged branch drak/doctrinebundles_tests (PR #2650)
Commits
-------

f83ef1e [DoctrineBundle] Fix tests - incorrect class names (copy paste error most probably)

Discussion
----------

[DoctrineBundle] Fix tests - incorrect class names

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

Some classes are incorrectly named resulting in failed tests for DoctrineBundle, looks like a copy paste error.
2011-11-15 07:57:44 +01:00
Fabien Potencier
a765c0a7d6 merged branch jdreesen/trans-formatting-fix (PR #2648)
Commits
-------

470f872 [FrameworkBundle] fixed formatting of farsi translation file

Discussion
----------

[FrameworkBundle] fixed formatting of farsi translation file

It now matches the other languages translation files.
2011-11-15 07:57:06 +01:00
Drak
f83ef1ec4a [DoctrineBundle] Fix tests - incorrect class names (copy paste error most probably) 2011-11-15 07:41:36 +05:45
jdreesen
470f872bf6 [FrameworkBundle] fixed formatting of farsi translation file 2011-11-14 20:33:13 +01:00
jdreesen
67d91f05d4 fixed typo in exception message 2011-11-14 20:16:31 +01:00