jacobwb / hashover-next

This branch will be HashOver 2.0
GNU Affero General Public License v3.0
420 stars 87 forks source link

get_magic_quotes_gpc() is deprecated wrong root directory #281

Closed nakohlyth closed 4 years ago

nakohlyth commented 4 years ago

latest master with php7.4.4 I had to comment this to bypass the error

// If so, strip escape slashes if enabled
                //if (get_magic_quotes_gpc ()) {
                //  $request = stripslashes ($request);
                //}

in

backend/classes/setup.php 
backend/classes/cookies.php

And now it's showing the form but everything have a wrong path css doesn't work. also happening in moderation, I can login but no path for templates is wrong and link to other sections doesn't work either.

my blog is in a sub-directory (also behind a reverse proxy if this is of any use)

the correct path which should be : domain.tld/blog/hashover/ is replaced by domain.tld/hashover/

127.0.0.1 - - [03/Apr/2020:21:13:26 +0200] "POST /hashover/backend/form-actions.php HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:13:36 +0200] "POST /hashover/backend/form-actions.php HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:13:42 +0200] "GET /hashover/themes/default/comments.css HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:13:55 +0200] "POST /hashover/backend/form-actions.php HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:16:55 +0200] "POST /hashover/backend/form-actions.php HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:17:09 +0200] "POST /hashover/backend/form-actions.php HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:17:36 +0200] "GET /grv/images/e/0/f/4/1/e0f411f67f7e92b92c824765cca730c8aa621947-unsplashtiagogerken.jpeg HTTP/1.0" 304 -
127.0.0.1 [03/Apr/2020:21:17:36 +0200] "GET /grv/hashover/comments.php HTTP/1.0" 200 105422
127.0.0.1 [03/Apr/2020:21:17:36 +0200] "POST /grv/hashover/backend/comments-ajax.php HTTP/1.0" 200 17375
127.0.0.1 - - [03/Apr/2020:21:17:36 +0200] "GET /hashover/themes/default/comments.css HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:17:36 +0200] "GET /hashover/images/first-comment.png HTTP/1.0" 404 196
195.234.109.176 - - [03/Apr/2020:21:17:37 +0200] "GET /hashover/images/avatar-45.png HTTP/1.0" 404 196
127.0.0.1 - - [03/Apr/2020:21:17:43 +0200] "GET /hashover/comments.php HTTP/1.0" 404 196
nakohlyth commented 4 years ago

~~by the way the form shows up because I did src="hashover/comments.php"></script> instead of src="/hashover/comments.php"></script> which is advised in the docs as the blog's root is in a sub-directory~~

so it's working if I put the hashover directory to the root directory of website. I had to change the use instruction to :

<script type="text/javascript" src="../hashover/comments.php"></script>

adnan360 commented 4 years ago

There is one other instance of this function, at line 78 in hashover/backend/classes/sessionlogin.php. It stopped me from rendering the comments and browser dev tool showed a json parse error (since the json contained the unfortunate php error which broke the syntax). I am using PHP 7.4.4

I added error_reporting(0); before those lines as a workaround and it seems to be fine. But maybe this should be fixed for the long term, since this is deprecated.

jacobwb commented 4 years ago

Thanks for reporting this issue, I have not had much time to test HashOver in PHP 7.4. I am now doing that testing and will fix any issues I find. This issue should now be fixed.