-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Have weak_vendors ignore deprecations from outside
phar:// and eval() can execute code that may or may not come from the vendors.
- Loading branch information
commit 9ce0ae23aee0cc32bbedb0436a47f267900017c0
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+6.67 KB
src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation.phar
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/deprecation/deprecation.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
@trigger_error('I come from… afar! :D', E_USER_DEPRECATED); |
4 changes: 4 additions & 0 deletions
4
src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/generate_phar.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
|
||
$phar = new Phar(__DIR__.DIRECTORY_SEPARATOR.'deprecation.phar', 0, 'deprecation.phar'); | ||
$phar->buildFromDirectory(__DIR__.DIRECTORY_SEPARATOR.'deprecation'); |
23 changes: 23 additions & 0 deletions
23
...fony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_eval_d_deprecation.phpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--TEST-- | ||
Test DeprecationErrorHandler in weak vendors mode on eval()'d deprecation | ||
--FILE-- | ||
<?php | ||
|
||
putenv('SYMFONY_DEPRECATIONS_HELPER=weak_vendors'); | ||
putenv('ANSICON'); | ||
putenv('ConEmuANSI'); | ||
putenv('TERM'); | ||
|
||
$vendor = __DIR__; | ||
while (!file_exists($vendor.'/vendor')) { | ||
$vendor = dirname($vendor); | ||
} | ||
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php'); | ||
require PHPUNIT_COMPOSER_INSTALL; | ||
require_once __DIR__.'/../../bootstrap.php'; | ||
eval("@trigger_error('who knows where I come from?', E_USER_DEPRECATED);") | ||
|
||
?> | ||
--EXPECTF-- | ||
|
||
Other deprecation notices (1) |
25 changes: 25 additions & 0 deletions
25
...ymfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_phar_deprecation.phpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
Test DeprecationErrorHandler in weak vendors mode on eval()'d deprecation | ||
The phar can be regenerated by running php src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/generate_phar.php | ||
--FILE-- | ||
<?php | ||
|
||
putenv('SYMFONY_DEPRECATIONS_HELPER=weak_vendors'); | ||
putenv('ANSICON'); | ||
putenv('ConEmuANSI'); | ||
putenv('TERM'); | ||
|
||
$vendor = __DIR__; | ||
while (!file_exists($vendor.'/vendor')) { | ||
$vendor = dirname($vendor); | ||
} | ||
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php'); | ||
require PHPUNIT_COMPOSER_INSTALL; | ||
require_once __DIR__.'/../../bootstrap.php'; | ||
\Phar::loadPhar(__DIR__.'/deprecation.phar', 'deprecation.phar'); | ||
include 'phar://deprecation.phar/deprecation.php'; | ||
|
||
?> | ||
--EXPECTF-- | ||
|
||
Other deprecation notices (1) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Have weak_vendors ignore deprecations from outside #24864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Have weak_vendors ignore deprecations from outside #24864
Changes from all commits
9ce0ae2
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.