Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
bug #1170 Make the default of debugHeadersData an array (TysonAndre)
Browse files Browse the repository at this point in the history
This PR was merged into the 6.2-dev branch.

Discussion
----------

Make the default of debugHeadersData an array

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Doc update?   | ?
| BC breaks?    | ?
| Deprecations? | no
| Fixed tickets |
| License       | MIT

See https://github.com/php/php-src/blob/PHP-7.1.26/UPGRADING#L81-L82

> The empty index operator (e.g. $str[] = $x) is not supported for strings
> anymore, and throws a fatal error instead of silently converting to array.

```
php > $x = new stdClass();
php > $x->prop = '';
php > $x->prop[] = 'value';
Warning: Uncaught Error: [] operator not supported for strings in php shell code:1
Stack trace:
#0 {main}
  thrown in php shell code on line 1
```

Detected via static analysis.

**The same issue is also detected in v5.4.12 in private $_debugHeadersData - I'm not sure if v5 aims to support php 7.1**

Commits
-------

5b6ba9a Make the default of debugHeadersData an array
  • Loading branch information
fabpot committed Jan 30, 2019
2 parents bb120bb + 5b6ba9a commit c2100aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/classes/Swift/Signers/DKIMSigner.php
Expand Up @@ -129,9 +129,9 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
/**
* If debugHeaders is set store debugData here.
*
* @var string
* @var string[]
*/
private $debugHeadersData = '';
private $debugHeadersData = [];

/**
* Stores the bodyHash.
Expand Down

0 comments on commit c2100aa

Please sign in to comment.