Skip to content

Fix in src/pfcurlprocessing.php for PHP7 compatibility #39

Description

@jhf2442

(sorry for not submitting a pull request, can't get it done - don't know what I'm doing wrong :-( )
pfcurlprocessing.php in PHP7 (Ubuntu 16.04) causes empty message content displayed

issue is caused by deprecated /e modifier in preg_replace. Fix is to go for preg_replace_callback

The 3 preg_replace statements must thus read :
$ret = preg_replace_callback("#(^|[\n ]])([\w]+?://[\w#$%()&~/!.-;:=,?@+]*)#is", function($m) { return "$m[1]<a href="$m[2]"" . $target . ">" . pfc_shorten_url($m[2]) . "";}, $ret);

$ret = preg_replace_callback("#(^|[\n ]])((www|ftp).[\w#$%&~/.-;:=,?@+]*)#is",function($m) { return "$m[1]<a href="http://$m[2]"" . $target . ">" . pfc_shorten_url($m[2]) . "";}, $ret);

$ret = preg_replace_callback("#(^|[\n ]])([a-z0-9&-_.]+?)@([\w-]+.([\w-.]+.)*[\w]+)#i", function($m) { return "$m[1]<a href="mailto:$m[2]@$m[3]">" . pfc_shorten_url($m[2].'@'.$m[3]) . "";}, $ret);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions