Commit b0687c9
committed
bug symfony#61401 [Process] Enhance hasSystemCallBeenInterrupted function for non-english locale (christianseel)
This PR was squashed before being merged into the 6.4 branch.
Discussion
----------
[Process] Enhance hasSystemCallBeenInterrupted function for non-english locale
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Related: PHPMailer/PHPMailer#3183
| License | MIT
We've been facing an issue with PHPMailer (PHPMailer/PHPMailer#3183) where `stream_select()` returns false, but because our application uses `setlocale(LC_ALL, 'de_DE.UTF-8')`, the PHP warning does **NOT** contain the string `'interrupted system call'` which results in unexpected behavior (no retry happening).
We did found a fix for this: PHPMailer/PHPMailer#3193
> I received a great hint by `@teefax` – who pointed out that the stream_select(): Unable to select part of the php warning message is not translated for other locales. Only the interrupted system call part is translated.
>
> That Unable to select is followed by an error number in square brackets. However that number can be different based on the operating system of the server. But PHP has a constant [SOCKET_EINTR](https://www.php.net/manual/en/sockets.constants.php#constant.socket-eintr) for that.
>
> So the recommendation is to check for the SOCKET_EINTR constant which is defined under Windows and UNIX-like platforms (if available on the platform) and use that with the other english warning text to catch those interrupted system calls for non-english locale applications.
>
> I left the existing check to avoid any potential unknown breaking change and extended the if-condition.
As I known Symfony was using a similar approach, I'm recommending to apply this enhancement to the "interrupted check" as well.
Commits
-------
013126d [Process] Enhance hasSystemCallBeenInterrupted function for non-english locale1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
62 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| |||
0 commit comments