marcelloc / Unofficial-pfSense-packages

Unofficial packages for pfSense software
125 stars 71 forks source link

Replace split() by preg_split() php funtion - was braking postfix on pfsense 2.4.4-p1 #48

Closed janek33 closed 5 years ago

janek33 commented 5 years ago

https://github.com/marcelloc/Unofficial-pfSense-packages/blob/060636cc7c04ff8da4c5244cab0ff82b4be8bf00/pkg-postfix/files/usr/local/pkg/postfix_dkim.inc#L82 $file_domain = array_pop(preg_split("/",$domain_path));

https://github.com/marcelloc/Unofficial-pfSense-packages/blob/060636cc7c04ff8da4c5244cab0ff82b4be8bf00/pkg-postfix/files/usr/local/pkg/postfix_dkim.inc#L301 $file_domain=array_pop(preg_split("/",$domain_path));

Could we replace split() by preg_split()

Notes from PHP docs: "split() is deprecated as of PHP 5.3.0. preg_split() is the suggested alternative to this function. If you don't require the power of regular expressions, it is faster to use explode(), which doesn't incur the overhead of the regular expression engine."

pfsense 2.3 upgraded PHP to 5.6 so it seems to be safe from this point of view.