From 0ed3513e66314da91cf3a28643182f2d3e2f666e Mon Sep 17 00:00:00 2001 From: Lorenzo Yario Date: Fri, 20 Dec 2024 14:43:13 -0600 Subject: [PATCH] add youtu.be and voca.ro --- inc/config.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/inc/config.php b/inc/config.php index 812ac89d..697a6fcf 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1150,28 +1150,29 @@ // Custom embedding (YouTube, vimeo, etc.) // It's very important that you match the entire input (with ^ and $) or things will not work correctly. // Be careful when creating a new embed, because depending on the URL you end up exposing yourself to an XSS. - $config['embedding'] = [ - [ - '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})?$/i', - '' - ], - [ + $config['embedding'] = array( + array( + '/^https?:\/\/(\w+\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9\-_]{10,11})?$/i', + '' + ), + array( '/^https?:\/\/(\w+\.)?vimeo\.com\/(\d{2,10})(\?.+)?$/i', '' - ], - [ + ), + array( '/^https?:\/\/(\w+\.)?dailymotion\.com\/video\/([a-zA-Z0-9]{2,10})(_.+)?$/i', '' - ], - [ + ), + array( '/^https?:\/\/(\w+\.)?metacafe\.com\/watch\/(\d+)\/([a-zA-Z0-9_\-.]+)\/(\?[^\'"<>]+)?$/i', '' - ], - [ - '/^https?:\/\/(\w+\.)?vocaroo\.com\/([a-zA-Z0-9]{2,12})$/i', - '' - ] - ]; + ), + array( + '/^https?:\/\/(\w+\.)?(vocaroo\.com\/|voca\.ro\/)([a-zA-Z0-9]{2,12})$/i', + '' + ), + + ); // Embedding width and height. $config['embed_width'] = 300;