GithubHelp home page GithubHelp logo

Comments (8)

ctgraham avatar ctgraham commented on June 29, 2024

I tested this in dev-2_4 with rewrites of:

RewriteEngine On
RewriteCond %{REQUEST_URI} !/index.php/
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^/index/(.*)$ /index.php/index/$1 [L]

RewriteCond %{REQUEST_URI} !/index.php/
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^(.*)$ /index.php/testjournal$1 [L]

and a config.inc.php of:

base_url = "http://my.test.journal/index"
base_url[testjournal] = "http://my.test.journal/"

and either force_ssl or force_login_ssl set to On.

My experience verifies the issue. I haven't gotten down to the cause or fix yet.

from pkp-lib.

ctgraham avatar ctgraham commented on June 29, 2024

Why would protocol redirects (https://github.com/pkp/pkp-lib/blob/ojs-dev-2_4/classes/core/PKPRequest.inc.php#L108 and https://github.com/pkp/pkp-lib/blob/ojs-dev-2_4/classes/core/PKPRequest.inc.php#L120) allow for the redirect to be anything other than $_SERVER['REQUEST_URI] with $_SERVER['QUERY_STRING'] appended?

from pkp-lib.

jprk avatar jprk commented on June 29, 2024

Dne 12. 1. 2015 21:43 "Clinton Graham" [email protected] napsal(a):

Why would protocol redirects (
https://github.com/pkp/pkp-lib/blob/ojs-dev-2_4/classes/core/PKPRequest.inc.php#L108
and
https://github.com/pkp/pkp-lib/blob/ojs-dev-2_4/classes/core/PKPRequest.inc.php#L120)
allow for the redirect to be anything other than $_SERVER['REQUEST_URI]
with $_SERVER['QUERY_STRING'] appended?

I guess that REQUEST_URI is at this moment already remapped to a stateful
URI by simply taking everything after index.php in the original request.
It is just a guess though, I would have to test it (and I will, but
probably not sooner than on Thursday).

I am just wondering whether plain HTTP redirects work in my setup, as the
code for both redirects is almost the same. Also something I will have to
test...

-- Jan

from pkp-lib.

ctgraham avatar ctgraham commented on June 29, 2024

Possible URI variants include:

  • index.php + querystring
  • index.php + PATH_INFO
  • mod_rewrite RESTful URL

Regardless of the above cases, I think the REQUEST_URI should be preserved on a protocol redirect.

In OJS 2.4.5, protocol redirects seem to be limited to:

That set still makes me think that the redirect should be based on REQUEST_URI and not on the URI variants. We're really just changing the protocol, not reconstructing the request. I haven't looked at OJS master, or the other PKP products which share lib-pkp, so I'm hoping one of the PKP devs with more experience can chime in.

from pkp-lib.

asmecher avatar asmecher commented on June 29, 2024

Thanks for the detailed investigation, @ctgraham and @jprk -- Clinton, your list of redirects looks correct to me.

The reasons for not using REQUEST_URI are lost in the mists of time, but I suspect it has something to do with that variable not always being available/accurate -- http://stackoverflow.com/questions/12772846/how-reliable-is-serverrequest-uri-at-capturing-query-strings rings a bell for me. This now looks to be a non-issue, however, so I think using REQUEST_URI in these few cases makes a lot of sense.

from pkp-lib.

asmecher avatar asmecher commented on June 29, 2024

(There are probably lots of general opportunities to introduce the use of protocol-relative URLs, by the way.)

from pkp-lib.

asmecher avatar asmecher commented on June 29, 2024

Merged, thanks!

from pkp-lib.

asmecher avatar asmecher commented on June 29, 2024

Also cherry-picked to pkp-lib omp-dev-1_1 and master branches.

from pkp-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.