-
Greetings. I have what I believe is a pretty standard 1.8.2 installation on Ubuntu 22.04. I'm not the primary person supporting this (he's on vacation...) and am floundering a bit. When people try to create a shortened link, the system is throwing: PHP Fatal error: Uncaught Error: Undefined constant "YOURLS_USER" in /var/www/html/user/plugins/yourls-domainlimit-plugin-master/plugin.php:28 I'm not well-versed at PHP, so I hope I'm not missing something sillily-obvious :) Can anyone point me in the right direction for a solution? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You're using a very old plugin, last updated 11 years ago. That said, I'm guessing that your install has public shortening enabled, and that the error described above only happens for users who aren't signed in. YOURLS only defines YOURLS/includes/functions-auth.php Lines 519 to 522 in b493c47 If the user isn't authenticated, that constant doesn't exist. The domainlimit plugin seems to assume that only authenticated users can shorten links, and doesn't check if This "worked" in older versions of PHP (and became a warning in PHP 7.2) because an undefined constant used to be interpreted as an unquoted string, i.e. the plugin ended up checking if
|
Beta Was this translation helpful? Give feedback.
-
Upgrading the Update this file on your server:
To use the updated code from here: https://github.com/nicwaller/yourls-domainlimit-plugin/blob/1.1.1/plugin.php |
Beta Was this translation helpful? Give feedback.
Upgrading the
yourls-domainlimit-plugin
plugin to version1.1.1
should fix the problem.Update this file on your server:
/var/www/html/user/plugins/yourls-domainlimit-plugin-master/plugin.php
To use the updated code from here:
https://github.com/nicwaller/yourls-domainlimit-plugin/blob/1.1.1/plugin.php