jimmyl0l3c / cfg_share_links

App for Nextcloud that adds the ability to specify share tokens
GNU Affero General Public License v3.0
32 stars 3 forks source link

Hyphen-minus (-) no more allowed in token because two regex do not match #278

Closed macbaed closed 2 weeks ago

macbaed commented 3 weeks ago

Environment:

Bug description The regex in AppConstants.php and TokenValidation do not match.

AppConstants.php DEFAULT_VALID_TOKENREGEX = '/^[a-zA-Z0-9]+$/'

TokenValidation.js regex in tokenValidityCheck method: /^[a-zA-Z0-9_-+]+$/

To Reproduce Steps to reproduce the behavior:

  1. Try to add token 1-123

Expected behavior

macbaed commented 3 weeks ago

My links contain hyphens. Why did you remove it in the regex?

jimmyl0l3c commented 2 weeks ago

Hi @macbaed, I forgot to update the regex on the frontend, thanks for the reminder.

My links contain hyphens. Why did you remove it in the regex?

Because of issue #223. Since NC 29 there are problems with links with hyphen which Nextcloud won't fix (see nextcloud/server/issues/45381)

macbaed commented 2 weeks ago

OK, thanks for the explanation. A little bit annoying for me, but not your fault.