mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 11:13:59 +02:00
[ticket/security-171] Sanitize data from composer.json
SECURITY-171
This commit is contained in:
@@ -123,6 +123,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
|
||||
}
|
||||
|
||||
$json = json_decode(file_get_contents($this->phpbb_root_path . 'ext/vendor2/foo/composer.json'), true);
|
||||
array_walk_recursive($json, array($manager, 'sanitize_json'));
|
||||
|
||||
$this->assertEquals($metadata, $json);
|
||||
}
|
||||
|
@@ -15,11 +15,13 @@ class phpbb_mock_metadata_manager extends \phpbb\extension\metadata_manager
|
||||
{
|
||||
public function set_metadata($metadata)
|
||||
{
|
||||
array_walk_recursive($metadata, array($this, 'sanitize_json'));
|
||||
$this->metadata = $metadata;
|
||||
}
|
||||
|
||||
public function merge_metadata($metadata)
|
||||
{
|
||||
array_walk_recursive($metadata, array($this, 'sanitize_json'));
|
||||
$this->metadata = array_merge($this->metadata, $metadata);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user