annotate vendor/brumann/polyfill-unserialize/README.md @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents
children
rev   line source
Chris@5 1 Polyfill unserialize [![Build Status](https://travis-ci.org/dbrumann/polyfill-unserialize.svg?branch=master)](https://travis-ci.org/dbrumann/polyfill-unserialize)
Chris@5 2 ===
Chris@5 3
Chris@5 4 Backports unserialize options introduced in PHP 7.0 to older PHP versions.
Chris@5 5 This was originally designed as a Proof of Concept for Symfony Issue [#21090](https://github.com/symfony/symfony/pull/21090).
Chris@5 6
Chris@5 7 You can use this package in projects that rely on PHP versions older than PHP 7.0.
Chris@5 8 In case you are using PHP 7.0+ the original `unserialize()` will be used instead.
Chris@5 9
Chris@5 10 From the [documentation](https://secure.php.net/manual/en/function.unserialize.php):
Chris@5 11
Chris@5 12 > Warning: Do not pass untrusted user input to unserialize(). Unserialization can
Chris@5 13 > result in code being loaded and executed due to object instantiation
Chris@5 14 > and autoloading, and a malicious user may be able to exploit this.
Chris@5 15
Chris@5 16 This warning holds true even when `allowed_classes` is used.
Chris@5 17
Chris@5 18 Requirements
Chris@5 19 ------------
Chris@5 20
Chris@5 21 - PHP 5.3+
Chris@5 22
Chris@5 23 Installation
Chris@5 24 ------------
Chris@5 25
Chris@5 26 You can install this package via composer:
Chris@5 27
Chris@5 28 ```
Chris@5 29 composer require brumann/polyfill-unserialize "^1.0"
Chris@5 30 ```
Chris@5 31
Chris@5 32 Known Issues
Chris@5 33 ------------
Chris@5 34
Chris@5 35 There is a mismatch in behavior when `allowed_classes` in `$options` is not
Chris@5 36 of the correct type (array or boolean). PHP 7.1 will issue a warning, whereas
Chris@5 37 PHP 7.0 will not. I opted to copy the behavior of the former.
Chris@5 38
Chris@5 39 Tests
Chris@5 40 -----
Chris@5 41
Chris@5 42 You can run the test suite using PHPUnit. It is intentionally not bundled as
Chris@5 43 dev dependency to make sure this package has the lowest restrictions on the
Chris@5 44 implementing system as possible.
Chris@5 45
Chris@5 46 Please read the [PHPUnit Manual](https://phpunit.de/manual/current/en/installation.html)
Chris@5 47 for information how to install it on your system.
Chris@5 48
Chris@5 49 You can run the test suite as follows:
Chris@5 50
Chris@5 51 ```
Chris@5 52 phpunit -c phpunit.xml.dist tests/
Chris@5 53 ```
Chris@5 54
Chris@5 55 Contributing
Chris@5 56 ------------
Chris@5 57
Chris@5 58 This package is considered feature complete. As such I will likely not update it
Chris@5 59 unless there are security issues.
Chris@5 60
Chris@5 61 Should you find any bugs or have questions, feel free to submit an Issue or a Pull Request.