nextcloud / unsplash

πŸ“ΈπŸ”€β˜οΈ Random Nextcloud log in background from Unsplash
https://apps.nextcloud.com/apps/unsplash
GNU Affero General Public License v3.0
92 stars 23 forks source link

Tags with dashes not working #128

Closed timonsky closed 1 month ago

timonsky commented 11 months ago

use GitHub reactions πŸ‘ to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug: Using keywords that contain dashes ('-') does not work. It seems the dashes are stripped before being passed to the URL builder.

To Reproduce: Steps to reproduce the behavior:

  1. Go to the Splash section in admin theming
  2. enter a keyword containing dashes (eg. 'picos-de-europa')
  3. reload the page
  4. right-clicking in the browser where the picture is visible (for me it was in the empty space next to the app tray; at the very edge should also work)
  5. getting the url from the 'Copy Image Link' shows that the url called is https://source.unsplash.com/featured/1920x1080?picosdeeuropa as in the tag had the dashes stripped

Expected behavior: Images should be taken from the tag containing dashes (e.g. https://source.unsplash.com/featured/1920x1080?picos-de-europa)

Server:

Additional Information:

timonsky commented 11 months ago

guessing it's this line that's responsible

Line 116 in lib/ProviderHandler/Provider.php $term = preg_replace('/[^a-z]/i','', $term);