Skip to content

Commit 6e8733f

Browse files
committed
fixed SendmailWrapper::stripStrLength() to also accept null value
1 parent 7411809 commit 6e8733f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ www-data ALL = (sendmailwrapper) NOPASSWD:/usr/sbin/sendmail-throttle [0-
8686
Add/modify the following in your php.ini:
8787

8888
```ini
89-
sendmail_path = "/usr/sbin/sendmail-wrapper -t -i"
89+
sendmail_path = /usr/sbin/sendmail-wrapper -t -i
9090
auto_prepend_file = /var/www/shared/prepend.php
9191
```
9292

@@ -169,7 +169,7 @@ If you stick with our default configuration, you need to update your `php.ini`:
169169

170170
```diff
171171
- sendmail_path = /usr/sbin/sendmail-wrapper
172-
+ sendmail_path = "/usr/sbin/sendmail-wrapper -t -i"
172+
+ sendmail_path = /usr/sbin/sendmail-wrapper -t -i
173173
```
174174

175175
If you don't care about Symfony Mailer or any other mailer components that check for `-t` existence in `sendmail_path`, you can keep the old `php.ini` configuration and add this to your `config.local.ini`:

app/SendmailWrapper.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@ public function run(): int
168168
/**
169169
* Limit a string to a specific length.
170170
*/
171-
public function stripStrLength(string $value, int $limit = null, string $suffix = null): string
171+
public function stripStrLength(?string $value, int $limit = null, string $suffix = null): string
172172
{
173-
$limit = $limit ?? $this->conf->syslog->stringLengthLimit;
173+
$value ??= '';
174+
$limit = $limit ?? $this->conf->syslog->stringLengthLimit;
174175
$suffix = $suffix ?? $this->conf->syslog->stringCutSuffix;
175176

176177
$strLen = mb_strlen($value);

0 commit comments

Comments
 (0)