PHP Warning – Only variables should be passed by reference

Hi,

Still going through checking on all plugin warnings and errors. I’ve traced one back to your Domain Mapping plugin, originating from classes/class.domainmap.php on lines 603/606/609, where it sets the cookie on login for mapped domains. I’m receiving the notice/warning “Only variables should be passed by reference” about ten to fifteen thousand times a day.

Cheers,

Ed

  • Barry
    • DEV MAN’s Mascot

    Sorry to be a pain – Is it possible for you to post the full error here? I have the “due to be released soon” development version on my current machine and the lines you refer to on that version (and on the 3.1.7 version I’ve just grabbed) don’t pass any variables.

    It may help to track down what is happening a bit quicker, and hopefully I can get a fix in this update before I have to get it released.

    Thanks

  • PrimaryT
    • Site Builder, Child of Zeus

    Hi Barry,

    The errors are actually picked up by NewRelic and I can’t see them in our error logs, probably due to us only logging errors and warnings PHP-FPM sees fit to send us. It only actually gives us that text “Only variables should be passed by reference” and nothing else. It doesn’t even show any of the domain mapping plugins files in the trace, but it only happens on the URLs produced from the plugin.

    Line 603 to 609 for me are:

    echo '<link rel="stylesheet" href="' . $url . $hash . '?action='.$action.'&uid='.$user->ID.'&build=' . date("Ymd", strtotime('-24 days') ) . '" type="text/css" media="screen" />';
    } else if ($_ssl) {
    $url = preg_replace( '/http:///', 'https://', $url );
    echo '<link rel="stylesheet" href="' . $url . $hash . '?action='.$action.'&uid='.$user->ID.'&build=' . date("Ymd", strtotime('-24 days') ) . '" type="text/css" media="screen" />';
    } else {
    $url = preg_replace( '/https:///', 'http://', $url );
    echo '<link rel="stylesheet" href="' . $url . $hash . '?action='.$action.'&uid='.$user->ID.'&build=' . date("Ymd", strtotime('-24 days') ) . '" type="text/css" media="screen" />';

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.