Skip to content

Missing $yourls_reserved_URL in config breaks adding shorturls #3769

@dgw

Description

@dgw

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.9.2

Description

If the config.php file does not set the $yourls_reserved_URL variable, trying to add a shorturl will make YOURLS try in_array( 'newkeyword', NULL) when checking if the keyword is reserved, and the script will crash.

Expectation

YOURLS should handle the case where this variable is not set, and treat it the same as if it is set to an empty array.

Reproduction steps

  1. Remove or comment out the definition of $yourls_reserved_URL in config.php
  2. Try to shorten a new URL

Context

Exposed via troubleshooting in #3767; documentation workaround suggested in #3768.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions