View Issue Details

IDProjectCategoryView StatusLast Update
0000695XMB1Bugspublic2024-04-23 13:12
Reporterflushedpancake Assigned Tomiqrogroove  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version1.9.12 
Target Version1.9.12.07Fixed in Version1.9.12.07 
Summary0000695: Improve youtube bbcode
DescriptionThis was discussed here on my own board, but it seems more appropriate for here: https://forums.xmbforum2.com/viewthread.php?tid=777153&goto=search&pid=1376475

Anyway, the regex in question is at https://github.com/Cirrusboard/Cirrusboard/blob/a4e6b07055da403fe97d3ca42b9cb2b7f68a6617/lib/post.php#L102 and IMO is more than sufficient, outside of it not recognising "m.youtube" urls. It however does recognise most other YT links you throw at it.

For the sakes of usability especially on mobile devices it would be nice to add this.
Steps To ReproduceInside of [youtube] bbcode, using YouTube URLs rather than video IDs isn't supported yet.
TagsNo tags attached.
MySQL Version
PHP Version
Web Server
Browser
Flags
Original Reporter
SVN Revision3049

Activities

miqrogroove

2024-04-20 09:44

administrator   ~0000490

Last edited: 2024-04-20 09:52

Yeah that particular regex seems naive and inefficient.

The most common YouTube URLs look like one of these:

https://www.youtube.com/watch?v=3JPMBV_Dto4

or

https://youtu.be/3JPMBV_Dto4?feature=shared

or

https://www.youtube.com/shorts/gyIZOQApa9U

So the only tokens that need to be parsed are the optional "v=" and the optional "/". If the only thing I have to do is add 2 tokens and run some tests, then I think this could be done on a patch release.

miqrogroove

2024-04-20 15:40

administrator   ~0000491

Available now in SVN and can be tested on the forum here. The only change is in functions.inc.php where the phrase youtube appears.

Issue History

Date Modified Username Field Change
2024-04-08 04:58 flushedpancake New Issue
2024-04-20 09:44 miqrogroove Assigned To => miqrogroove
2024-04-20 09:44 miqrogroove Status new => acknowledged
2024-04-20 09:44 miqrogroove Note Added: 0000490
2024-04-20 09:46 miqrogroove Note Edited: 0000490
2024-04-20 09:52 miqrogroove Note Edited: 0000490
2024-04-20 15:40 miqrogroove Status acknowledged => resolved
2024-04-20 15:40 miqrogroove Category New Features => Bugs
2024-04-20 15:40 miqrogroove Product Version => 1.9.12
2024-04-20 15:40 miqrogroove Fixed in Version => 1.9.12.07
2024-04-20 15:40 miqrogroove Target Version => 1.9.12.07
2024-04-20 15:40 miqrogroove Description Updated
2024-04-20 15:40 miqrogroove Steps to Reproduce Updated
2024-04-20 15:40 miqrogroove SVN Revision => 3049
2024-04-20 15:40 miqrogroove Note Added: 0000491
2024-04-23 13:12 miqrogroove Resolution open => fixed