Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong path when loading via symlink #211

Closed
CyberShadow opened this issue Mar 4, 2018 · 2 comments
Closed

Wrong path when loading via symlink #211

CyberShadow opened this issue Mar 4, 2018 · 2 comments

Comments

@CyberShadow
Copy link
Contributor

$ git clone https://github.com/jacobwb/hashover-next ~/hashover-next
$ # configure hashover-next
$ cd ~/www # directory served by HTTP server
$ ln -s ../hashover-next/hashover hashover
$ echo '<script src="hashover/comments.php"></script>' > test.php
$ xdg-open http://localhost/test.php

This results in hashover inserting:

<link rel="stylesheet" href="hover-next/hashover/themes/default/comments.css" type="text/css">
@CyberShadow
Copy link
Contributor Author

Looks like PHP is unconditionally realpathing __DIR__. Annoying.

@CyberShadow
Copy link
Contributor Author

Worked around it by overriding $http_directory = "/hashover"; in settings.php. I guess it would need to be made configurable...

jacobwb added a commit that referenced this issue Mar 5, 2019
The directory name from __DIR__ is a better choice, `$_SERVER['PHP_SELF']` is not suitable for this, because it changes based on where the script is executing from.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant