Merge branch '2.4'
* 2.4: fixed typos Fixed deprecated method calls Add testing against HHVM at Travis-CI Fixed typo Fixed typo Fixed typo fixed acronyms [Validator] Fixed IBAN validator with 0750447346 value Conflicts: src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
This commit is contained in:
commit
7d80045b22
@ -5,12 +5,17 @@ php:
|
|||||||
- 5.3
|
- 5.3
|
||||||
- 5.4
|
- 5.4
|
||||||
- 5.5
|
- 5.5
|
||||||
|
- hhvm
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- php: hhvm
|
||||||
|
|
||||||
services: mongodb
|
services: mongodb
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- sudo apt-get install parallel
|
- sudo apt-get install parallel
|
||||||
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
|
- sh -c 'if [ $(php -r "echo (int) defined("HHVM_VERSION");") -eq 0 ]; then echo "" >> "~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini"; fi;'
|
||||||
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||||
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
|
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
|
||||||
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||||
|
@ -27,7 +27,7 @@ class DoctrineOrmExtension extends AbstractExtension
|
|||||||
protected function loadTypes()
|
protected function loadTypes()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Type\EntityType($this->registry, PropertyAccess::getPropertyAccessor()),
|
new Type\EntityType($this->registry, PropertyAccess::createPropertyAccessor()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ abstract class DoctrineType extends AbstractType
|
|||||||
public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null)
|
public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null)
|
||||||
{
|
{
|
||||||
$this->registry = $registry;
|
$this->registry = $registry;
|
||||||
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
|
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
@ -24,7 +24,7 @@ class PropelExtension extends AbstractExtension
|
|||||||
protected function loadTypes()
|
protected function loadTypes()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Type\ModelType(PropertyAccess::getPropertyAccessor()),
|
new Type\ModelType(PropertyAccess::createPropertyAccessor()),
|
||||||
new Type\TranslationCollectionType(),
|
new Type\TranslationCollectionType(),
|
||||||
new Type\TranslationType()
|
new Type\TranslationType()
|
||||||
);
|
);
|
||||||
|
@ -57,7 +57,7 @@ class ModelType extends AbstractType
|
|||||||
|
|
||||||
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
|
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
|
||||||
{
|
{
|
||||||
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
|
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
@ -45,8 +45,8 @@ CHANGELOG
|
|||||||
* replaced Symfony\Component\HttpKernel\Debug\ContainerAwareTraceableEventDispatcher by Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
|
* replaced Symfony\Component\HttpKernel\Debug\ContainerAwareTraceableEventDispatcher by Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
|
||||||
* added Client::enableProfiler()
|
* added Client::enableProfiler()
|
||||||
* a new parameter has been added to the DIC: `router.request_context.base_url`
|
* a new parameter has been added to the DIC: `router.request_context.base_url`
|
||||||
You can customize it for your functional tests or for generating urls with
|
You can customize it for your functional tests or for generating URLs with
|
||||||
the right base url when your are in the cli context.
|
the right base URL when your are in the CLI context.
|
||||||
* added support for default templates per render tag
|
* added support for default templates per render tag
|
||||||
|
|
||||||
2.1.0
|
2.1.0
|
||||||
|
@ -57,8 +57,8 @@
|
|||||||
|
|
||||||
<service id="templating.asset.request_aware_package" class="Symfony\Component\Templating\Asset\PackageInterface" factory-service="templating.asset.package_factory" factory-method="getPackage" abstract="true">
|
<service id="templating.asset.request_aware_package" class="Symfony\Component\Templating\Asset\PackageInterface" factory-service="templating.asset.package_factory" factory-method="getPackage" abstract="true">
|
||||||
<argument type="service" id="request" strict="false" />
|
<argument type="service" id="request" strict="false" />
|
||||||
<argument /> <!-- http id -->
|
<argument /> <!-- HTTP id -->
|
||||||
<argument /> <!-- ssl id -->
|
<argument /> <!-- SSL id -->
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="templating.asset.package_factory" class="%templating.asset.package_factory.class%">
|
<service id="templating.asset.package_factory" class="%templating.asset.package_factory.class%">
|
||||||
|
@ -74,7 +74,7 @@ class GlobalVariables
|
|||||||
/**
|
/**
|
||||||
* Returns the current request.
|
* Returns the current request.
|
||||||
*
|
*
|
||||||
* @return Request|null The http request object
|
* @return Request|null The HTTP request object
|
||||||
*/
|
*/
|
||||||
public function getRequest()
|
public function getRequest()
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ abstract class WebTestCase extends \PHPUnit_Framework_TestCase
|
|||||||
* PHPUnit will use the last configuration argument on the command line, so this only returns
|
* PHPUnit will use the last configuration argument on the command line, so this only returns
|
||||||
* the last configuration argument.
|
* the last configuration argument.
|
||||||
*
|
*
|
||||||
* @return string The value of the PHPUnit cli configuration option
|
* @return string The value of the PHPUnit CLI configuration option
|
||||||
*/
|
*/
|
||||||
private static function getPhpUnitCliConfigArgument()
|
private static function getPhpUnitCliConfigArgument()
|
||||||
{
|
{
|
||||||
|
@ -153,7 +153,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
|||||||
|
|
||||||
$this->assertEquals('request', $container->getDefinition('templating.helper.assets')->getScope(), '->registerTemplatingConfiguration() sets request scope on assets helper if one or more packages are request-scoped');
|
$this->assertEquals('request', $container->getDefinition('templating.helper.assets')->getScope(), '->registerTemplatingConfiguration() sets request scope on assets helper if one or more packages are request-scoped');
|
||||||
|
|
||||||
// default package should have one http base url and path package ssl url
|
// default package should have one HTTP base URL and path package SSL URL
|
||||||
$this->assertTrue($container->hasDefinition('templating.asset.default_package.http'));
|
$this->assertTrue($container->hasDefinition('templating.asset.default_package.http'));
|
||||||
$package = $container->getDefinition('templating.asset.default_package.http');
|
$package = $container->getDefinition('templating.asset.default_package.http');
|
||||||
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\DefinitionDecorator', $package);
|
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\DefinitionDecorator', $package);
|
||||||
|
@ -45,7 +45,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$translator = $this->getTranslator($this->getLoader());
|
$translator = $this->getTranslator($this->getLoader());
|
||||||
$translator->setLocale('fr');
|
$translator->setLocale('fr');
|
||||||
$translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
|
$translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR'));
|
||||||
|
|
||||||
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
||||||
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
||||||
@ -61,7 +61,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||||||
// prime the cache
|
// prime the cache
|
||||||
$translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir));
|
$translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir));
|
||||||
$translator->setLocale('fr');
|
$translator->setLocale('fr');
|
||||||
$translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
|
$translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR'));
|
||||||
|
|
||||||
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
||||||
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
||||||
@ -75,7 +75,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
|||||||
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
|
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
|
||||||
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir));
|
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir));
|
||||||
$translator->setLocale('fr');
|
$translator->setLocale('fr');
|
||||||
$translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
|
$translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR'));
|
||||||
|
|
||||||
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
$this->assertEquals('foo (FR)', $translator->trans('foo'));
|
||||||
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
$this->assertEquals('bar (EN)', $translator->trans('bar'));
|
||||||
|
@ -37,7 +37,7 @@ class ProfilerController
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param UrlGeneratorInterface $generator The Url Generator
|
* @param UrlGeneratorInterface $generator The URL Generator
|
||||||
* @param Profiler $profiler The profiler
|
* @param Profiler $profiler The profiler
|
||||||
* @param \Twig_Environment $twig The twig environment
|
* @param \Twig_Environment $twig The twig environment
|
||||||
* @param array $templates The templates
|
* @param array $templates The templates
|
||||||
|
@ -412,7 +412,7 @@ abstract class Client
|
|||||||
*
|
*
|
||||||
* This method returns null if the DomCrawler component is not available.
|
* This method returns null if the DomCrawler component is not available.
|
||||||
*
|
*
|
||||||
* @param string $uri A uri
|
* @param string $uri A URI
|
||||||
* @param string $content Content for the crawler to use
|
* @param string $content Content for the crawler to use
|
||||||
* @param string $type Content type
|
* @param string $type Content type
|
||||||
*
|
*
|
||||||
@ -534,9 +534,9 @@ abstract class Client
|
|||||||
/**
|
/**
|
||||||
* Takes a URI and converts it to absolute if it is not already absolute.
|
* Takes a URI and converts it to absolute if it is not already absolute.
|
||||||
*
|
*
|
||||||
* @param string $uri A uri
|
* @param string $uri A URI
|
||||||
*
|
*
|
||||||
* @return string An absolute uri
|
* @return string An absolute URI
|
||||||
*/
|
*/
|
||||||
protected function getAbsoluteUri($uri)
|
protected function getAbsoluteUri($uri)
|
||||||
{
|
{
|
||||||
|
@ -157,7 +157,7 @@ class DialogHelperTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNoInteration()
|
public function testNoInteraction()
|
||||||
{
|
{
|
||||||
$dialog = new DialogHelper();
|
$dialog = new DialogHelper();
|
||||||
|
|
||||||
|
@ -162,10 +162,10 @@ class ErrorHandler
|
|||||||
|
|
||||||
// we must stop the PHP script execution, as the exception has
|
// we must stop the PHP script execution, as the exception has
|
||||||
// already been dealt with, so, let's throw an exception that
|
// already been dealt with, so, let's throw an exception that
|
||||||
// will be catched by a dummy exception handler
|
// will be caught by a dummy exception handler
|
||||||
set_exception_handler(function (\Exception $e) use ($exceptionHandler) {
|
set_exception_handler(function (\Exception $e) use ($exceptionHandler) {
|
||||||
if (!$e instanceof DummyException) {
|
if (!$e instanceof DummyException) {
|
||||||
// happens if our dummy exception is catched by a
|
// happens if our dummy exception is caught by a
|
||||||
// catch-all from user code, in which case, let's the
|
// catch-all from user code, in which case, let's the
|
||||||
// current handler handle this "new" exception
|
// current handler handle this "new" exception
|
||||||
call_user_func($exceptionHandler, $e);
|
call_user_func($exceptionHandler, $e);
|
||||||
|
@ -112,7 +112,7 @@ class Link
|
|||||||
if ('?' === $uri[0]) {
|
if ('?' === $uri[0]) {
|
||||||
$baseUri = $this->currentUri;
|
$baseUri = $this->currentUri;
|
||||||
|
|
||||||
// remove the query string from the current uri
|
// remove the query string from the current URI
|
||||||
if (false !== $pos = strpos($baseUri, '?')) {
|
if (false !== $pos = strpos($baseUri, '?')) {
|
||||||
$baseUri = substr($baseUri, 0, $pos);
|
$baseUri = substr($baseUri, 0, $pos);
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ class Link
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns raw uri data.
|
* Returns raw URI data.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -712,7 +712,7 @@ EOF
|
|||||||
$this->assertEquals('http://base.com/link', $crawler->filterXPath('//a')->link()->getUri());
|
$this->assertEquals('http://base.com/link', $crawler->filterXPath('//a')->link()->getUri());
|
||||||
|
|
||||||
$crawler = new Crawler('<html><base href="//base.com"><a href="link"></a></html>', 'https://domain.com');
|
$crawler = new Crawler('<html><base href="//base.com"><a href="link"></a></html>', 'https://domain.com');
|
||||||
$this->assertEquals('https://base.com/link', $crawler->filterXPath('//a')->link()->getUri(), '<base> tag can use a schema-less url');
|
$this->assertEquals('https://base.com/link', $crawler->filterXPath('//a')->link()->getUri(), '<base> tag can use a schema-less URL');
|
||||||
|
|
||||||
$crawler = new Crawler('<html><base href="path/"><a href="link"></a></html>', 'https://domain.com');
|
$crawler = new Crawler('<html><base href="path/"><a href="link"></a></html>', 'https://domain.com');
|
||||||
$this->assertEquals('https://domain.com/path/link', $crawler->filterXPath('//a')->link()->getUri(), '<base> tag can set a path');
|
$this->assertEquals('https://domain.com/path/link', $crawler->filterXPath('//a')->link()->getUri(), '<base> tag can set a path');
|
||||||
|
@ -262,7 +262,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
|
|||||||
* @param object $listener The listener
|
* @param object $listener The listener
|
||||||
* @param string $eventName The event name
|
* @param string $eventName The event name
|
||||||
*
|
*
|
||||||
* @return array Informations about the listener
|
* @return array Information about the listener
|
||||||
*/
|
*/
|
||||||
private function getListenerInfo($listener, $eventName)
|
private function getListenerInfo($listener, $eventName)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +87,7 @@ class ObjectChoiceList extends ChoiceList
|
|||||||
*/
|
*/
|
||||||
public function __construct($choices, $labelPath = null, array $preferredChoices = array(), $groupPath = null, $valuePath = null, PropertyAccessorInterface $propertyAccessor = null)
|
public function __construct($choices, $labelPath = null, array $preferredChoices = array(), $groupPath = null, $valuePath = null, PropertyAccessorInterface $propertyAccessor = null)
|
||||||
{
|
{
|
||||||
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
|
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
|
||||||
$this->labelPath = null !== $labelPath ? new PropertyPath($labelPath) : null;
|
$this->labelPath = null !== $labelPath ? new PropertyPath($labelPath) : null;
|
||||||
$this->groupPath = null !== $groupPath ? new PropertyPath($groupPath) : null;
|
$this->groupPath = null !== $groupPath ? new PropertyPath($groupPath) : null;
|
||||||
$this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null;
|
$this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null;
|
||||||
|
@ -24,7 +24,7 @@ class CoreExtension extends AbstractExtension
|
|||||||
protected function loadTypes()
|
protected function loadTypes()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Type\FormType(PropertyAccess::getPropertyAccessor()),
|
new Type\FormType(PropertyAccess::createPropertyAccessor()),
|
||||||
new Type\BirthdayType(),
|
new Type\BirthdayType(),
|
||||||
new Type\CheckboxType(),
|
new Type\CheckboxType(),
|
||||||
new Type\ChoiceType(),
|
new Type\ChoiceType(),
|
||||||
|
@ -31,7 +31,7 @@ class FormType extends BaseType
|
|||||||
|
|
||||||
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
|
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
|
||||||
{
|
{
|
||||||
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
|
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,7 @@ class RedirectResponse extends Response
|
|||||||
*
|
*
|
||||||
* @param string $url The URL to redirect to
|
* @param string $url The URL to redirect to
|
||||||
* @param integer $status The status code (302 by default)
|
* @param integer $status The status code (302 by default)
|
||||||
* @param array $headers The headers (Location is always set to the given url)
|
* @param array $headers The headers (Location is always set to the given URL)
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*
|
*
|
||||||
|
@ -881,14 +881,14 @@ class Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the root url from which this request is executed.
|
* Returns the root URL from which this request is executed.
|
||||||
*
|
*
|
||||||
* The base URL never ends with a /.
|
* The base URL never ends with a /.
|
||||||
*
|
*
|
||||||
* This is similar to getBasePath(), except that it also includes the
|
* This is similar to getBasePath(), except that it also includes the
|
||||||
* script filename (e.g. index.php) if one exists.
|
* script filename (e.g. index.php) if one exists.
|
||||||
*
|
*
|
||||||
* @return string The raw url (i.e. not urldecoded)
|
* @return string The raw URL (i.e. not urldecoded)
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@ -1615,13 +1615,13 @@ class Request
|
|||||||
$requestUri = $this->headers->get('X_REWRITE_URL');
|
$requestUri = $this->headers->get('X_REWRITE_URL');
|
||||||
$this->headers->remove('X_REWRITE_URL');
|
$this->headers->remove('X_REWRITE_URL');
|
||||||
} elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') {
|
} elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') {
|
||||||
// IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)
|
// IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem)
|
||||||
$requestUri = $this->server->get('UNENCODED_URL');
|
$requestUri = $this->server->get('UNENCODED_URL');
|
||||||
$this->server->remove('UNENCODED_URL');
|
$this->server->remove('UNENCODED_URL');
|
||||||
$this->server->remove('IIS_WasUrlRewritten');
|
$this->server->remove('IIS_WasUrlRewritten');
|
||||||
} elseif ($this->server->has('REQUEST_URI')) {
|
} elseif ($this->server->has('REQUEST_URI')) {
|
||||||
$requestUri = $this->server->get('REQUEST_URI');
|
$requestUri = $this->server->get('REQUEST_URI');
|
||||||
// HTTP proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path
|
// HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, only use URL path
|
||||||
$schemeAndHttpHost = $this->getSchemeAndHttpHost();
|
$schemeAndHttpHost = $this->getSchemeAndHttpHost();
|
||||||
if (strpos($requestUri, $schemeAndHttpHost) === 0) {
|
if (strpos($requestUri, $schemeAndHttpHost) === 0) {
|
||||||
$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
|
$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
|
||||||
|
@ -1242,7 +1242,7 @@ class Response
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we need to remove Cache-Control for ssl encrypted downloads when using IE < 9
|
* Check if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9
|
||||||
*
|
*
|
||||||
* @link http://support.microsoft.com/kb/323308
|
* @link http://support.microsoft.com/kb/323308
|
||||||
*/
|
*/
|
||||||
|
@ -205,10 +205,10 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertEquals('example@example.com', $bag->filter('email', '', false, FILTER_VALIDATE_EMAIL), '->filter() gets a value of parameter as email');
|
$this->assertEquals('example@example.com', $bag->filter('email', '', false, FILTER_VALIDATE_EMAIL), '->filter() gets a value of parameter as email');
|
||||||
|
|
||||||
$this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, array('flags' => FILTER_FLAG_PATH_REQUIRED)), '->filter() gets a value of parameter as url with a path');
|
$this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, array('flags' => FILTER_FLAG_PATH_REQUIRED)), '->filter() gets a value of parameter as URL with a path');
|
||||||
|
|
||||||
// This test is repeated for code-coverage
|
// This test is repeated for code-coverage
|
||||||
$this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED), '->filter() gets a value of parameter as url with a path');
|
$this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED), '->filter() gets a value of parameter as URL with a path');
|
||||||
|
|
||||||
$this->assertFalse($bag->filter('dec', '', false, FILTER_VALIDATE_INT, array(
|
$this->assertFalse($bag->filter('dec', '', false, FILTER_VALIDATE_INT, array(
|
||||||
'flags' => FILTER_FLAG_ALLOW_HEX,
|
'flags' => FILTER_FLAG_ALLOW_HEX,
|
||||||
|
@ -715,7 +715,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
|||||||
));
|
));
|
||||||
$port = $request->getPort();
|
$port = $request->getPort();
|
||||||
|
|
||||||
$this->assertEquals(80, $port, 'If X_FORWARDED_PROTO is set to http return 80.');
|
$this->assertEquals(80, $port, 'If X_FORWARDED_PROTO is set to HTTP return 80.');
|
||||||
|
|
||||||
$request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
|
$request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
|
||||||
'HTTP_X_FORWARDED_PROTO' => 'On'
|
'HTTP_X_FORWARDED_PROTO' => 'On'
|
||||||
|
@ -187,7 +187,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a http kernel from the container
|
* Gets a HTTP kernel from the container
|
||||||
*
|
*
|
||||||
* @return HttpKernel
|
* @return HttpKernel
|
||||||
*/
|
*/
|
||||||
|
@ -1123,7 +1123,7 @@ class Process
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Captures the exitcode if mentioned in the process informations.
|
* Captures the exitcode if mentioned in the process information.
|
||||||
*/
|
*/
|
||||||
private function captureExitCode()
|
private function captureExitCode()
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ namespace Symfony\Component\Routing\Generator;
|
|||||||
* params because they come from third party libs but don't want to have a 404 in
|
* params because they come from third party libs but don't want to have a 404 in
|
||||||
* production environment. It should log the mismatch so one can review it.
|
* production environment. It should log the mismatch so one can review it.
|
||||||
* - setStrictRequirements(null): Return the URL with the given parameters without
|
* - setStrictRequirements(null): Return the URL with the given parameters without
|
||||||
* checking the requirements at all. When generating an URL you should either trust
|
* checking the requirements at all. When generating a URL you should either trust
|
||||||
* your params or you validated them beforehand because otherwise it would break your
|
* your params or you validated them beforehand because otherwise it would break your
|
||||||
* link anyway. So in production environment you should know that params always pass
|
* link anyway. So in production environment you should know that params always pass
|
||||||
* the requirements. Thus this option allows to disable the check on URL generation for
|
* the requirements. Thus this option allows to disable the check on URL generation for
|
||||||
|
@ -188,7 +188,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
|
|||||||
$url = '/';
|
$url = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
// the contexts base url is already encoded (see Symfony\Component\HttpFoundation\Request)
|
// the contexts base URL is already encoded (see Symfony\Component\HttpFoundation\Request)
|
||||||
$url = strtr(rawurlencode($url), $this->decodedChars);
|
$url = strtr(rawurlencode($url), $this->decodedChars);
|
||||||
|
|
||||||
// the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3
|
// the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3
|
||||||
|
@ -199,7 +199,7 @@ class ExceptionListener
|
|||||||
*/
|
*/
|
||||||
protected function setTargetPath(Request $request)
|
protected function setTargetPath(Request $request)
|
||||||
{
|
{
|
||||||
// session isn't required when using http basic authentication mechanism for example
|
// session isn't required when using HTTP basic authentication mechanism for example
|
||||||
if ($request->hasSession() && $request->isMethodSafe()) {
|
if ($request->hasSession() && $request->isMethodSafe()) {
|
||||||
$request->getSession()->set('_security.'.$this->providerKey.'.target_path', $request->getUri());
|
$request->getSession()->set('_security.'.$this->providerKey.'.target_path', $request->getUri());
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class HttpUtils
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
|
* @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
|
||||||
* @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The Url or Request matcher
|
* @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The URL or Request matcher
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
@ -146,7 +146,7 @@ class HttpUtils
|
|||||||
|
|
||||||
$url = $this->urlGenerator->generate($path, $request->attributes->all(), UrlGeneratorInterface::ABSOLUTE_URL);
|
$url = $this->urlGenerator->generate($path, $request->attributes->all(), UrlGeneratorInterface::ABSOLUTE_URL);
|
||||||
|
|
||||||
// unnecessary query string parameters must be removed from url
|
// unnecessary query string parameters must be removed from URL
|
||||||
// (ie. query parameters that are presents in $attributes)
|
// (ie. query parameters that are presents in $attributes)
|
||||||
// fortunately, they all are, so we have to remove entire query string
|
// fortunately, they all are, so we have to remove entire query string
|
||||||
$position = strpos($url, '?');
|
$position = strpos($url, '?');
|
||||||
|
@ -146,7 +146,7 @@ class PoFileLoader extends ArrayLoader implements LoaderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save a translation item to the messeages.
|
* Save a translation item to the messages.
|
||||||
*
|
*
|
||||||
* A .po file could contain by error missing plural indexes. We need to
|
* A .po file could contain by error missing plural indexes. We need to
|
||||||
* fix these before saving them.
|
* fix these before saving them.
|
||||||
|
@ -30,6 +30,13 @@ class IbanValidator extends ConstraintValidator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// An IBAN without a country code is not an IBAN.
|
||||||
|
if (0 === preg_match('/[A-Za-z]/', $value)) {
|
||||||
|
$this->context->addViolation($constraint->message, array('{{ value }}' => $value));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$teststring = preg_replace('/\s+/', '', $value);
|
$teststring = preg_replace('/\s+/', '', $value);
|
||||||
|
|
||||||
if (strlen($teststring) < 4) {
|
if (strlen($teststring) < 4) {
|
||||||
|
@ -181,6 +181,7 @@ class IbanValidatorTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('CY170020 128 0000 0012 0052 7600'),
|
array('CY170020 128 0000 0012 0052 7600'),
|
||||||
array('foo'),
|
array('foo'),
|
||||||
array('123'),
|
array('123'),
|
||||||
|
array('0750447346')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user