MyBB Community Forums
[Security] Custom Profile Field Expression - How to check for valid image url? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [Security] Custom Profile Field Expression - How to check for valid image url? (/thread-193564.html)



Custom Profile Field Expression - How to check for valid image url? - Firelad - 2016-05-28

As exactly as the title said... I want to know what is the correct expression for checking the valid image url - but specific website.

Thanks.


RE: Custom Profile Field Expression - How to check for valid image url? - Firelad - 2016-05-30

Bump.


RE: Custom Profile Field Expression - How to check for valid image url? - kawaii - 2016-05-30

You can use this as an example. It only validates Imgur URLs that use HTTPS.

^$|(https:\/\/i.imgur\.com\/[a-zA-Z0-9]{6,8})(\.jpg|\.gif|\.gifv|\.png)(?:[^a-zA-Z0-9]|$)



RE: Custom Profile Field Expression - How to check for valid image url? - Firelad - 2016-06-04

(2016-05-30, 10:36 AM)Marisa Wrote: You can use this as an example. It only validates Imgur URLs that use HTTPS.

^$|(https:\/\/i.imgur\.com\/[a-zA-Z0-9]{6,8})(\.jpg|\.gif|\.gifv|\.png)(?:[^a-zA-Z0-9]|$)

This is actually perfect! I wanted Imgur and you whooped up the magic expression. Big Grin


RE: Custom Profile Field Expression - How to check for valid image url? - izakgewdrick - 2016-06-04

Then give rep and mark thread as solved Smile Thank you


RE: Custom Profile Field Expression - How to check for valid image url? - kawaii - 2016-06-04

(2016-06-04, 03:24 AM)Firelad Wrote:
(2016-05-30, 10:36 AM)Marisa Wrote: You can use this as an example. It only validates Imgur URLs that use HTTPS.

^$|(https:\/\/i.imgur\.com\/[a-zA-Z0-9]{6,8})(\.jpg|\.gif|\.gifv|\.png)(?:[^a-zA-Z0-9]|$)

This is actually perfect! I wanted Imgur and you whooped up the magic expression. Big Grin

No problem, glad I could help. Angel