Changes between Initial Version and Version 1 of Ticket #54385, comment 33
- Timestamp:
- 11/19/2021 10:41:04 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #54385, comment 33
initial v1 9 9 > Thanks for the feedback @stevegs and @TobiasBg... re: `str_contains`, in the latest patch I use `substr_count( $str, '/' )` to ensure the string contains one and only one `/` which @jrf suggested on the PR. What do you think? 10 10 11 This seems to be the most elegant solution. I've checked that `substr_count('2//5', '/')` returns 2, as does `substr_count('2/24/5', '/')` - so it will catch more than one /whether consecutive or not. And it's backward compatible with PHP7.11 This seems to be the most elegant solution. I've checked that `substr_count('2//5', '/')` returns 2, as does `substr_count('2/24/5', '/')` - so it will catch more than one `/` whether consecutive or not. And it's backward compatible with PHP7.