Closed antoinebidault closed 3 years ago
Thanks a lot for maintaining this project !
No problem! Should be fixed in v1.0.5
- went with \S
for the part before office just to keep in consistent & not restrict based on other potential characters.
Bug Report
Current Behavior I am not able to validate the current Microsoft Teams webhook url. The webhook url format has probably changed, the url format is looking like this : https://**{my organization name}.webhook.office.com/webhookb2**/ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ@ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ/IncomingWebhook/ZZZZZZZZZZZZZZZ/ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ
Curiously if i change this url to https://**outlook**.office.com/**webhook**/ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ@ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ/IncomingWebhook/ZZZZZZZZZZZZZZZ/ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ-ZZZZZ It's working.
Steps to Reproduce
Expected Behavior The webhook url provided by teams might be validated.
Screenshots
Environment FreeFlarum.com
Possible solution(s)
The regex in that file might be improved or changed: https://github.com/FriendsOfFlarum/webhooks/blob/master/src/Adapters/MicrosoftTeams/Adapter.php
I am not an expert in regex, but maybe this one will cover both the old and the new webhook url version : *^https:\/\/[a-z-_.+].office.com\/webhook(b2)?\/\S+@\S+\/IncomingWebhook\/\S+\/\S+$**
See the example with both url : https://regex101.com/r/VJgCJd/1
Hope that helps. Thanks a lot for maintaining this project !