Skip to content

Commit e8b102e

Browse files
Merge branch '2.7' into 2.8
* 2.7: [ci] use hirak/prestissimo [Filesystem] Fix transient tests [HttpFoundation] Avoid warnings when checking malicious IPs [HttpFoundation] Set the Content-Range header if the requested Range is unsatisfied Conflicts: src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php
2 parents ff93c1a + def0176 commit e8b102e

File tree

14 files changed

+102
-10
lines changed

14 files changed

+102
-10
lines changed
File renamed without changes.

.composer/composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"require": {
3+
"php": ">=5.3.7",
4+
"hirak/prestissimo": "^0.1.15"
5+
}
6+
}

.composer/composer.lock

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ before_install:
4949
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0; fi;
5050
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
5151
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
52-
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
5352
- if [[ $deps != skip ]]; then composer self-update; fi;
53+
- if [[ $deps != skip && $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer/* ~/.composer/; composer global install --prefer-dist; fi;
5454
- if [[ $deps != skip ]]; then ./phpunit install; fi;
5555
- export PHPUNIT=$(readlink -f ./phpunit)
5656

appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ init:
1818
install:
1919
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
2020
- cd c:\php
21+
- IF %PHP%==1 appveyor DownloadFile https://curl.haxx.se/ca/cacert.pem
2122
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.3.11-nts-Win32-VC9-x86.zip
2223
- IF %PHP%==1 7z x php-5.3.11-nts-Win32-VC9-x86.zip -y >nul
2324
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/ICU-51.2-dlls.zip
@@ -38,6 +39,8 @@ install:
3839
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini-min
3940
- IF %PHP%==1 echo extension_dir=ext >> php.ini-min
4041
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini-min
42+
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini-min
43+
- IF %PHP%==1 echo curl.cainfo=c:\php\cacert.pem >> php.ini-min
4144
- IF %PHP%==1 copy /Y php.ini-min php.ini-max
4245
- IF %PHP%==1 echo extension=php_apcu.dll >> php.ini-max
4346
- IF %PHP%==1 echo apc.enable_cli=1 >> php.ini-max
@@ -51,7 +54,8 @@ install:
5154
- copy /Y php.ini-max php.ini
5255
- cd c:\projects\symfony
5356
- mkdir %APPDATA%\Composer
54-
- IF %APPVEYOR_REPO_NAME%==symfony/symfony copy /Y .composer-auth.json %APPDATA%\Composer\auth.json
57+
- IF %APPVEYOR_REPO_NAME%==symfony/symfony copy /Y .composer\* %APPDATA%\Composer\
58+
- IF %APPVEYOR_REPO_NAME%==symfony/symfony composer global install --prefer-dist --no-progress --ansi || echo curl.cainfo needs PHP 5.3.7
5559
- php phpunit install
5660
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
5761
- composer update --prefer-dist --no-progress --ansi

src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
2222

2323
public function prepare_workspace()
2424
{
25-
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000);
25+
$this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
2626
mkdir($this->workspace, 0777, true);
2727
$this->workspace = realpath($this->workspace);
2828
}

src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function setUp()
4646
{
4747
$this->umask = umask(0);
4848
$this->filesystem = new Filesystem();
49-
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().mt_rand(0, 1000);
49+
$this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
5050
mkdir($this->workspace, 0777, true);
5151
$this->workspace = realpath($this->workspace);
5252
}

src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ public function prepare(Request $request)
253253
if ($start <= $end) {
254254
if ($start < 0 || $end > $fileSize - 1) {
255255
$this->setStatusCode(416);
256+
$this->headers->set('Content-Range', sprintf('bytes */%s', $fileSize));
256257
} elseif ($start !== 0 || $end !== $fileSize - 1) {
257258
$this->maxlen = $end < $fileSize ? $end - $start + 1 : -1;
258259
$this->offset = $start;

src/Symfony/Component/HttpFoundation/IpUtils.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ public static function checkIp6($requestIp, $ip)
112112
$netmask = 128;
113113
}
114114

115-
$bytesAddr = unpack('n*', inet_pton($address));
116-
$bytesTest = unpack('n*', inet_pton($requestIp));
115+
$bytesAddr = unpack('n*', @inet_pton($address));
116+
$bytesTest = unpack('n*', @inet_pton($requestIp));
117+
118+
if (!$bytesAddr || !$bytesTest) {
119+
return false;
120+
}
117121

118122
for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) {
119123
$left = $netmask - 16 * ($i - 1);

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,8 @@ public function getClientIps()
830830

831831
if (!filter_var($clientIp, FILTER_VALIDATE_IP)) {
832832
unset($clientIps[$key]);
833+
834+
continue;
833835
}
834836

835837
if (IpUtils::checkIp($clientIp, self::$trustedProxies)) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy