@@ -186,11 +186,15 @@ function s2_mail_comment ($name, $email, $text, $title, $url, $auth_name, $unsub
186
186
'Reply-To: ' .$ from ;
187
187
188
188
// Change the linebreaks used in the headers according to OS
189
- if (strtoupper (substr (PHP_OS , 0 , 3 )) == 'MAC ' )
190
- $ headers = str_replace ("\r\n" , "\r" , $ headers );
191
- else if (strtoupper (substr (PHP_OS , 0 , 3 )) != 'WIN ' )
192
- $ headers = str_replace ("\r\n" , "\n" , $ headers );
193
-
189
+ if (!defined ('PHP_VERSION_ID ' ) || PHP_VERSION_ID < 80000 ) {
190
+ // Change the linebreaks used in the headers according to OS
191
+ if (strtoupper (substr (PHP_OS , 0 , 3 )) === 'MAC ' ) {
192
+ $ headers = str_replace ("\r\n" , "\r" , $ headers );
193
+ }
194
+ else if (strtoupper (substr (PHP_OS , 0 , 3 )) !== 'WIN ' ) {
195
+ $ headers = str_replace ("\r\n" , "\n" , $ headers );
196
+ }
197
+ }
194
198
mail ($ email , $ subject , $ message , $ headers );
195
199
}
196
200
@@ -226,12 +230,15 @@ function s2_mail_moderator ($name, $email, $text, $title, $url, $auth_name, $aut
226
230
'X-Mailer: S2 Mailer ' ."\r\n" .
227
231
'Reply-To: ' .$ from ;
228
232
229
- // Change the linebreaks used in the headers according to OS
230
- if (strtoupper (substr (PHP_OS , 0 , 3 )) == 'MAC ' )
231
- $ headers = str_replace ("\r\n" , "\r" , $ headers );
232
- else if (strtoupper (substr (PHP_OS , 0 , 3 )) != 'WIN ' )
233
- $ headers = str_replace ("\r\n" , "\n" , $ headers );
234
-
233
+ if (!defined ('PHP_VERSION_ID ' ) || PHP_VERSION_ID < 80000 ) {
234
+ // Change the linebreaks used in the headers according to OS
235
+ if (strtoupper (substr (PHP_OS , 0 , 3 )) === 'MAC ' ) {
236
+ $ headers = str_replace ("\r\n" , "\r" , $ headers );
237
+ }
238
+ else if (strtoupper (substr (PHP_OS , 0 , 3 )) !== 'WIN ' ) {
239
+ $ headers = str_replace ("\r\n" , "\n" , $ headers );
240
+ }
241
+ }
235
242
mail ($ email , $ subject , $ message , $ headers );
236
243
}
237
244
0 commit comments