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

Some URLs are broken #104

Open
AlphaJack opened this issue Jan 27, 2022 · 1 comment
Open

Some URLs are broken #104

AlphaJack opened this issue Jan 27, 2022 · 1 comment

Comments

@AlphaJack
Copy link

I have noticed that some URLs are broken at the moment:

Main CSS

As per #91, frontend/header.php contains

<link rel="stylesheet" href="<?php echo $YOURLS_SITE ?>/frontend/dist/styles.css">

But somehow $YOURLS_SITE is empty so the final URL is /frontend/dist/styles.css.

If I change it to YOURLS_SITE, I get the error 500 with the following text:

2022/01/27 00:38:04 [error] 9851#9851: *24768 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Undefined constant "YOURLS_SITE" in /usr/share/webapps/yourls/frontend/header.php:15
Stack trace:
#0 /usr/share/webapps/yourls/index.php(1): include()
#1 {main}
  thrown in /usr/share/webapps/yourls/frontend/header.php on line 15" while reading response header from upstream, client: 192.168.1.1, server: example.org, request: "GET /yourls/ HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "example.org"

However, if I hardcode the website URL also inf frontend/config.php

define('YOURLS_SITE', 'https://example.org/yourls');

I can view the CSS file but I get the following warning:

2022/01/27 00:46:51 [error] 9851#9851: *24773 FastCGI sent in stderr: "PHP message: PHP Warning:  Constant YOURLS_SITE already defined in /etc/webapps/yourls/config.php on line 40" while reading response header from upstream, client: 192.168.1.1, server: example.org, request: "GET /yourls/ HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "example.org"

Logo image

index.php

Unlike the icon URL, the logo URL is generating prepending YOURLS_SITE to the path specified for the image. This breaks if the image is outslde YOURLS folder:

<img src="https://example.org/yourlshttps://example.org/logo.png" alt="Logo" width="95px" class="mt-n5">```
@SophiaAtkinson
Copy link

SophiaAtkinson commented Apr 20, 2022

to fix this remove echo from <?php echo $YOURLS_SITE ?>/frontend/dist/styles.css">
so it should be this
<?php $YOURLS_SITE ?>/frontend/dist/styles.css">
I had this same problem and this fixed the issue.

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

2 participants