url::paramSeparator() - Error 500 on Post

I have been using


on many different occasions already and i have been trying to troubleshoot an error for a few hours now where i try to create a pdf on the fly from an url which uses said separator function.

to illustrate,

having some sort of checkout process, where i am creating an email with invoice as attachment seems to work fine with the “error producing code below” when running it via the site’s visitors browser.

however, in that said checkout process, when chosing to pay with paypal ipn ( seems like a POST or whatever i going on, the paramseparator does not seem to function, i tried to manually dump all values, and everything else worked.

when replacing the paramseparator with >> ; << it seems to work as well.

I tried testing the whole thing though ngrok because obviously i need to expose my localhost to web to test against paypal sandbox


// this produces error 500
$mail->addStringAttachment(file_get_contents($order->url().'/key'.url::paramSeparator().$data['token'].'/invoice'.url::paramSeparator().$order->hash()), $order->hash().'.pdf');

// this seems to work locally as on a windows machine that's the correct one....
$mail->addStringAttachment(file_get_contents($order->url().'/key;'.$data['token'].'/invoice;'.$order->hash()), $order->hash().'.pdf');


please note that without having the remotely response from paypal, the actual same line with the paramseparator work when called…

i’m not sure whats wrong, but could it be that whatever the reason, it’s putting a >> : << instead of >> ; << and thus leading to an fatal error because the url is not correct? i mean, getting the call from paypal would still make paramseparator identify that the server is running on a windows localhost thus choosing the right separator, right? since dump didn’t print anything, i am not to sure about the result though…

so either something works differently when using ngrok, or paypal ipn call messes up some stuff. anyone has experience and can clarify?

hm, the function itself is not very complicated…

detect::windows() true or false, but i wonder, why it’s not outputting the correct result when paypal accessing it via the ipn callback…