Dear all,
our journal is one of multiple journals in the OJS installation of our library. The journal has it’s own domain: https://meta-journal.net. To have nice urls like https://meta-journal.net/issue/current we have rewrite rules of apache in place.
For the plugin I’m developing I need the URL of the page requested. The PKPRequest
provides the getCompleteUrl
and getRequestUrl
methods. The problem for me right now is that both methods return the URL with the context_id included.
So instead of: Archiv | Middle East - Topics & Arguments
I get: Archiv | Middle East - Topics & Arguments
Is there a possibility to get the initial (not rewritten) url that I’m missing?
Best,
Markus
Hi @MarHerUMR,
How are you using the generated URL? Can you use the Request::url
function?
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @asmecher,
thanks, this is exactly what I wanted (and didn’t see). Both, the Request.inc.php and the PKPRequest.inc.php state the method as deprecated. Do you know what method to use instead??
The url will be inserted as a <meta>
tag.
Best,
Markus
Hi @MarHerUMR,
I suppose you could pick something directly out of the $_SERVER
array – but if you’re dogmatically dumping user-supplied content into your meta fields, watch out for potential abuses.
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @asmecher,
because of the potential abuse of the input I decided to go with the Request::url
method (and actually using it the right way). It would be great when there’s are equivalent when the url method will be removed.
Best,
Markus