Commit Graph

231 Commits

Author SHA1 Message Date
Fabien Potencier
3d5054f21f [Security] added unit tests for the Authentication sub-namespace 2010-10-31 13:39:12 +01:00
Fabien Potencier
eb4d51f181 [HttpKernel] fixed phpdoc typos 2010-10-31 12:55:30 +01:00
Fabien Potencier
3506dfabff [HttpKernel] added a return value to the purge() method of the Cache store class 2010-10-30 21:15:43 +02:00
Fabien Potencier
dd9b77ed96 [HttpFoundation] added Response::setVary() 2010-10-30 21:02:05 +02:00
jeff
ae888b80f6 [HttpFoundation] removed port number from HOST header
To be consistent with backup values (SERVER_NAME, SERVER_ADDR).
fix a problem with getUriForPath($path) where port number may be present twice.
2010-10-28 15:14:48 +02:00
jeff
a5d4acc54d [HttpFoundation] updated get() signature to get($key, $default = null, $first = true)
This is more consistent with the get() method of ParameterBag
2010-10-28 15:12:48 +02:00
Fabien Potencier
13f36b1657 Removed logic that tried to avoid double-escaping
Because that's just not possible (have a look at the unit tests to see all possibilities
-- as you will notice, there is no way we can determine the context and whether the
data are already escaped or not).

So, we always escape data, which means that sometimes, we will try to escape already
escaped data. This is not a problem for everything except strings. That's because
strings are not wrapped with an object like everything else (for performance reason).

This means that all escapers must be able to avoid double-escaping (that's the case
for the default escapers as both htmlspecialchars() and htmlentities() have a flag
that does just this).
2010-10-28 13:32:10 +02:00
Fabien Potencier
3eee458430 [OutputEscaper] replaced the JS escaper with the one from Twig 2010-10-28 13:31:02 +02:00
Fabien Potencier
4cf5b440a9 [OutputEscaper] fixed variable init 2010-10-28 13:00:12 +02:00
Fabien Potencier
7f8c540a20 [Routing] fixed XML loader on Windows (there is no need to urlencode here as schemaValidate() takes a filename, not a URL) 2010-10-28 09:17:11 +02:00
Fabien Potencier
c448429e62 [HttpFoundation] fixed date format for HTTP headers (format must be RFC1123, not RFC2822 -- the difference is that RFC1123 dates always use GMT for the timezone) 2010-10-27 10:56:56 +02:00
Fabien Potencier
e23c3cc702 [OutputEscaper] made getEscaper*() methods more consistent with the way you can change the escaping strategy in __call() 2010-10-26 22:39:01 +02:00
Fabien Potencier
c065be88b5 [OutputEscaper] refactored the component 2010-10-26 22:28:33 +02:00
Fabien Potencier
988722b23b [DependencyInjection] fixed phpdoc 2010-10-26 16:01:39 +02:00
Johannes M. Schmitt
3463f47698 applies base64 encoding directly to the binary data instead of their hexadecimal representation 2010-10-24 10:57:06 +02:00
Dominique Bongiraud
6885f90f17 [HttpKernel\Security]Fixed use statement and updated parameters constructor 2010-10-24 09:55:40 +02:00
Dominique Bongiraud
c0ef9fb0ea [HttpKernel\Security]Fixed markup 2010-10-24 09:55:37 +02:00
Dominique Bongiraud
a85bca395a [Security]Fixed markup 2010-10-24 09:55:32 +02:00
Dominique Bongiraud
66ff8073b9 [Security]Fixed CS 2010-10-24 09:55:31 +02:00
Fabien Potencier
4027f751e3 [Security] added more unit tests 2010-10-22 17:48:58 +02:00
Fabien Potencier
d2b184e058 [Security] removed type hint in AuthenticationException as the extra information can be of different classes 2010-10-22 15:19:13 +02:00
Johannes Schmitt
d077ac4158 [Security] changed encoders to use hash() function whenver possible and replaced sha1 with sha256 as default algorithm 2010-10-22 13:24:29 +02:00
Ryan Weaver
84a60d74d1 Allowing a routes node to be specified without any child import or route nodes.
This is not really a bug or a big issue, but if you need to temporarily empty a routes node, Symfony shouldn't care - it's not an actual validation failure (a routes node still makes sense without an route or import children).
2010-10-22 13:21:55 +02:00
Bernhard Schussek
96a0bff915 [Form] Made InputField instantiable so that simple input fields can be created on the fly 2010-10-22 08:30:14 +02:00
Bernhard Schussek
e9fcacdad7 [HttpFoundation] Fixed: File/UploadedFile did not adjust path when moved 2010-10-22 08:30:14 +02:00
Bernhard Schussek
72dcee594a [Form] Added validiation of hours, minutes and seconds to TimeField 2010-10-22 08:30:14 +02:00
Bernhard Schussek
6c7fab212b [Form] Added validation of years, months and days to DateField 2010-10-22 08:30:13 +02:00
Bernhard Schussek
e4c21708ca [Form] Separated value transformers from normalization transformers.
Fields can now easier support different data types in their underlying object.
These datatypes can be normalized to a single datatype using a normalization
transformer. The normalized value can then be transformed to the user's
representation with the value transformer (better name required?).
2010-10-22 08:30:13 +02:00
Bernhard Schussek
733290c112 [Form] Implemented UrlField 2010-10-22 08:30:13 +02:00
Bernhard Schussek
eaef939141 [Form] Changed value transformers to be responsible for processing empty values to be able to chain them properly. This change fixes the bug that DateField did not return NULL when submitted without values 2010-10-22 08:30:13 +02:00
Ryan Weaver
cc4f2bd955 Adding a type-hint to XmlFileLoader::validate(). 2010-10-22 08:22:08 +02:00
Victor Berchet
4dacdcc4ec [Security] Use a negative length parameter to simplify the code 2010-10-21 18:24:57 +02:00
Fabien Potencier
82f8ab839f [Security] added some unit tests (WIP) 2010-10-21 18:14:32 +02:00
Fabien Potencier
836c512585 fixed interfaces problems 2010-10-21 17:16:31 +02:00
Fabien Potencier
bf3659d5bb added an exception when trying to extend a template with a decorator that uses a different renderer (for instance when a Twig template tries to extend a PHP one) 2010-10-21 08:57:31 +02:00
Artur Kotyrba
2682bc2be5 [Security] Fixed typo 2010-10-21 08:30:46 +02:00
Fabien Potencier
92c56a5066 Revert "[Routing] allowed multiple routing requirement with xml loader, using comma separated values"
This reverts commit e8bcbcba57.
2010-10-21 08:13:10 +02:00
Jordi Boggiano
48155ccc2f [DependencyInjection] Regex optimization 2010-10-21 07:48:12 +02:00
Jordi Boggiano
2186535848 [DependencyInjection] Removed useless code 2010-10-21 07:48:06 +02:00
Fabien Potencier
0749038e73 [Security] changed the way passwords are compared to avoid timing attacks 2010-10-21 07:36:55 +02:00
fivestar
cb0f63f84b [HttpKernel] fixed typo at Security\Firewall\DigestAuthenticationListener 2010-10-20 18:37:35 +02:00
ornicar
e8bcbcba57 [Routing] allowed multiple routing requirement with xml loader, using comma separated values 2010-10-20 14:32:36 +02:00
Justin Hileman
0ccc9805f5 Fix UniversalClassLoader issues with leading slashes.
This fixes a bug in UniversalClassLoader when attempting to autoload class names with leading slashes:

    $namespacedClass = "\\Foo\\Bar";
    $pearlikeClass   = "\\Foo_Bar";

    $namespaced = new $namespacedClass();
    $pearlike   = new $pearlikeClass();

`UniversalClassLoader::loadClass()` was unable to load PEAR-like classes with leading slashes because it found the slash and assumed that the requested class was namespaced. It was unable to load namespaced classes with leading slashes because it would look them up in the autoloader's registered namespaces, and was unable to match '\Foo' to 'Foo'. One (ugly) workaround for the namespaced classes was to register all namespaces twice:

    $loader->registerNamespaces(array(
        'Foo'  => __DIR__ . '/lib',
        '\Foo' => __DIR__ . '/lib',
    ));

But that's not very pretty, nor does it solve the bug with PEAR-like classes. Stripping the leading slash before trying to autoload allows UniversalClassLoader to load both namespaced and PEAR-like classes.
2010-10-20 14:20:12 +02:00
Fabien Potencier
dd4f87b8c2 made form login configurable 2010-10-20 11:42:19 +02:00
Pascal Borreli
437f8c7a86 [Security] Fixed typo 2010-10-20 07:07:54 +02:00
Jeremy Mikola
0aba8ef720 [DependencyInjection] XmlFileLoader should allow "factory-service" attribute without "class" for <service> 2010-10-19 21:10:07 +02:00
Pascal Borreli
d067d5da69 [Security] Fixed coding standard 2010-10-19 17:22:31 +02:00
Pascal Borreli
fde278d7a8 [Security] Fixed typo 2010-10-19 17:21:28 +02:00
Pascal Borreli
8df4567a82 [CssSelector] Fixed typo 2010-10-19 17:20:34 +02:00
Fabien Potencier
f216f313e8 added the Security Component and its integration into the MVC framework
Happy birthday symfony!
2010-10-19 13:33:17 +02:00
Fabien Potencier
0fc6b15c17 [HttpFoundation] added a way to clear the session attributes 2010-10-19 13:13:20 +02:00
Fabien Potencier
94347f73c5 [HttpFoundation] added a way to generate a URI based on the current one and a path 2010-10-19 13:13:14 +02:00
Kris Wallsmith
4a18624927 [Validator] removed ftp and ftps from default url protocols 2010-10-18 16:57:07 +02:00
Kris Wallsmith
f79e23ffb5 Removed all those spaces after @author that were bothering me so… 2010-10-18 16:55:41 +02:00
Kris Wallsmith
0b1f3145ae Removed unnecessary "public" from interface method signatures. 2010-10-18 16:55:09 +02:00
Artur Kotyrba
308e85a5a7 Removed methods which implemented interfaces by throwing \LogicException('You must override...'). 2010-10-17 07:54:18 +02:00
pborreli
80868f1712 [Translation] Fixed phpdoc, thx Koc 2010-10-17 07:52:22 +02:00
pborreli
86cc6a11d9 [Component] Fixed some spelling typos 2010-10-17 07:51:50 +02:00
pborreli
082090d880 [Validator] Fixed coding standard 2010-10-16 10:49:41 +02:00
Kris Wallsmith
5d4c80f27b [Validator] removed DependencyInjection integration 2010-10-16 08:34:36 +02:00
Kris Wallsmith
ef4f61bb9f [DependencyInjection] Added TaggedContainerInterface to signature of generated container classes 2010-10-16 08:32:07 +02:00
Fabien Potencier
7e66933876 fixed inconsistency when calling the Http Kernel instance from an event 2010-10-15 11:02:35 +02:00
Jeremy Mikola
df9ef79953 [Form] readPropertyPath should return null instead of empty array
When reading the last bit of a property path mapped to a missing array index, the method would initialize the value to an empty array.  This makes sense for cases where readPropertyPath would again be called recursively, but not when the value would be immediately returned (null would be preferable in that case).

For example, we have an object with a property called "options" that's an array of arbitrary key/value pairs.  That "options" property (and getOptions()) maps directly to a FieldGroup within the Form for this object.  That FieldGroup contains multiple TextFields for a few expected keys in the array.  As-is, if those keys were not defined, the default data set for those TextFields could end up being "Array" (string representation of an empty array).  If readPropertyPath instead returns null for this case, the default data would be transformed into an empty string.
2010-10-13 08:17:05 +02:00
Fabien Potencier
2b8dfe1ccf [EventDispatcher] fixed possible PHP warning 2010-10-13 07:44:14 +02:00
Benjamin Zikarsky
d376596f7e [EventDispatcher] fixed bug in EventDispatcher::disconnect if the second argument is null or ommitted 2010-10-13 07:41:56 +02:00
Tom Van Looy
44f54c2578 [Console] fixed status code when it is > 255 2010-10-13 07:33:49 +02:00
Ryan Weaver
c39635680f added PHPDoc 2010-10-13 07:29:41 +02:00
Fabien Potencier
2a9ddee162 [HttpFoundation] added Session::invalidate() 2010-10-12 08:58:12 +02:00
Ryan Weaver
7fb3b2ab9d Adding basic PHPDoc to the Routing\DelegatingLoader class. 2010-10-12 06:58:54 +02:00
Ryan Weaver
8c70a2ee24 Adding basic PHPDoc to the Routing\DelegatingLoader class. 2010-10-12 06:58:51 +02:00
Bernhard Schussek
b902cb31d7 [Form] PropertyPath camelizes property names when setting values 2010-10-11 12:52:22 +02:00
Bernhard Schussek
a66d883afd [Form] Removed CSRF setters because they have no effect once CSRF protection is enabled. Re-enable CSRF protection with the desired values instead 2010-10-11 12:52:17 +02:00
Bernhard Schussek
e1be4e9689 [Form] Refactored logic to read and set values from Field to PropertyPath 2010-10-11 12:52:10 +02:00
ornicar
06a6b15e22 [Form] Fix FieldGroup::getHiddenFields, add tests for FieldGroup::getHiddenFields and FieldGroup::getVisibleFields 2010-10-09 14:20:06 +02:00
Fabien Potencier
fafcd02684 [HttpFoundation] changed RequestMatcher pattern syntax 2010-10-07 19:12:53 +02:00
Jordi Boggiano
d8f4cb79c9 [Form] Turned FieldGroup::getFields() into 4 specialized methods for more flexibility
It's better to be able to fetch all the visible and all the hidden fields separately for display purposes (hidden fields in <ul> tags without an <li> do not validate)
2010-10-06 15:34:07 +02:00
Jordi Boggiano
bf1eb56a34 [EventDispatched] Event doesn't need to implement ArrayAccess 2010-10-06 14:33:52 +02:00
Fabien Potencier
1d1a437edc added some missing methods 2010-10-06 14:18:36 +02:00
Benjamin Eberlei
ec3b3f7637 Added and tested EntityToIDTransformer to transform Many-To-One and One-To-One entities into their identifier values 2010-10-06 14:16:55 +02:00
Benjamin Eberlei
0d9d4ac583 Optimize some code in Form/Configurable, Have ChoiceField always pass data to transformers, implemented and fully unit-tested two Doctrine ORM specific transformers that do Collection to String/Choice Transformations 2010-10-06 14:16:51 +02:00
Benjamin Eberlei
f033fc5578 Refactor ValueTransformers to recieve the original value when reverseTransform() is called. This is required for expensive value transformations for example Doctrine Collections or Proxies to allow access to a value that does not trigger expensive operations (such as database calls) anymore. 2010-10-06 14:16:47 +02:00
Fabien Potencier
dbde494424 made locale determination for translation lazy-loaded
This allows to have a stateless-website (without any cookie)
for instance if the locale is part of the domain name
and not attached to the user.
2010-10-06 11:57:38 +02:00
Fabien Potencier
caa9d82746 [HttpFoundation] added support for attributes in RequestMatcher 2010-10-05 20:20:28 +02:00
Fabien Potencier
2525998f6e replaced form field rendering with plain templates
Documentation available here:

http://docs.symfony-reloaded.org/master/guides/form/
2010-10-05 08:34:33 +02:00
Fabien Potencier
0fc8906feb [Validator] forced all validation annotations to be in the validation namespace to avoid collisions, removed the need for the wrapping @Validation annotation
Before:

    /**
     * @Validation({@DateTime()})
     */

After:

    /**
     * @validation:DateTime()
     */

The @validation:Validation() construct is not needed anymore (it is still supported
as this is useful when you have several annotations with the same class).

So, the above is equivalent to:

    /**
     * @validation:Validation({@validation:DateTime()})
     */
2010-10-02 15:07:00 +02:00
Fabien Potencier
3a4d9cb185 [Validation] fixed license 2010-10-02 12:42:35 +02:00
Fabien Potencier
4deb82f842 [Form] fixed license and phpdoc 2010-10-02 12:38:14 +02:00
Fabien Potencier
1a055fc7f0 [Validator] fixed typo 2010-09-30 07:21:54 +02:00
Jordi Boggiano
d28b9ddcda [HttpFoundation] Fix session::remove() not initializing the session 2010-09-30 07:17:44 +02:00
Fabien Potencier
0d7c403769 [Form] fixed camelization problem when looking for a method (getCreated_at -> getCreatedAt) 2010-09-29 08:08:25 +02:00
Fabien Potencier
3b1e83380b [Validator] removed the convention that error parameters are delimited with %% 2010-09-29 07:59:45 +02:00
Fabien Potencier
6aa190b2a6 [OutputEscaper] added SafeDecoratorInterface 2010-09-28 22:19:17 +02:00
Fabien Potencier
4ac65cebcf [Translation] renamed Range to Interval 2010-09-28 07:14:43 +02:00
Fabien Potencier
9e50782b9d fixed request data collector 2010-09-27 21:17:37 +02:00
Fabien Potencier
707205410e added an IdentityTranslator to make it possible to always relies on the translator service, even if none is configured 2010-09-27 16:53:44 +02:00
Sebastian Ionescu
4edd0c269b updated some helper docblocks - fixed usage of helpers 2010-09-27 15:16:23 +02:00
Fabien Potencier
9580c74f0b [Validator] changed the convention for placeholders in messages to be compatible with Twig (from %limit% to {{ limit }}) 2010-09-27 09:46:56 +02:00
Fabien Potencier
a7537906b4 [Translation] added the component 2010-09-27 09:45:29 +02:00
Fabien Potencier
35ee15d131 [DependencyInjection] tweaked an error message to ease debugging 2010-09-26 16:59:40 +02:00
Brandon Turner
b2e4b452a4 [Form] added support for stdClass objects
ReflectionClass doesn't list properties on stdClass objects (or objects cast
from arrays).  This allows these annoymous objects to be used as field data.
2010-09-25 07:57:58 +02:00