@davidlemaitre opened this Issue on November 7th 2022

I want to use config:delete command to remove an ip address from General.login_allowlist_ip array but the command never found the value. If I add a new value without dots to an array, the deletion works. I tried to escape dots with backslashes without success.

Steps to Reproduce

./console config:set 'General.login_allowlist_ip[]=""'
Setting [General] login_allowlist_ip = ""... done.
./console config:get 'General.login_allowlist_ip'`
./console config:delete --section=General --key=login_allowlist_ip[] --value=`
Nothing found

Your Environment

  • Matomo Version: 4.12.3
  • PHP Version: 8.0.25
@peterhashair commented on November 7th 2022 Contributor

@davidlemaitre thanks for reporting this, you are right, I can see there is a bug there caused by the IP address having dot in it. Instead of searching for, it searches 123

@peterhashair commented on November 7th 2022 Contributor

Hints: this is caused by this line.

possible solution:

update the regex to /^([a-zA-Z0-9_]+)(?:\.([a-zA-Z0-9_]+))?(?:\[\])?(?:\.([a-zA-Z0-9_.]+))?/, not sure if we want to accept all special characters

Powered by GitHub Issue Mirror