| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Sorry for messing around with the related issue, I thought it was related to #22 but I think actually it's a slightly different problem after re-reading the original description closely. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@colbyfayock can you take a look on this? |
Sorry, something went wrong.
|
Sorry, I missed that @orimdominic. That seems reasonable and probably more foolproof, although I think the path.extname part won't work in browsers. The big regex could be replaced with that split though which seems a lot simpler. I'll take a look if I get time. |
Sorry, something went wrong.
|
Nice to know @gpoole |
Sorry, something went wrong.
|
im not great at regex, but one thing to consider is the extension isn't required
|
Sorry, something went wrong.
|
@colbyfayock as the extension is removed with a .replace, it will only remove one if found but if there is no extension nothing will happen. I've added a test validating that's the case. @orimdominic I had a go at the solution you suggested but unfortunately it doesn't quite work, since the extracted ID with that method includes the v12345/ part of the path, which caused tests to fail. I was going to try stripping the v12345 bit, but when I was looking at the existing regex again I noticed that it also handles a lot of variants of the URL format, such as the path including private/ or youtube/ instead of upload/, so I think it's probably safer and simpler to keep it as is. |
Sorry, something went wrong.
This is great! 👍 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fix for public IDs containing multiple dots before the extension getting truncated. For example, in 0.2.4 https://res.cloudinary.com/xyz/image/upload/v111111111/Folder/Name.With.Multiple.Dots.png is extracted as Folder/Name instead of Folder/Name.With.Multiple.Dots. This fix (maybe incorrectly) assumes everything after the last . is an extension, but it does correctly include any dots before the last . in the ID so it should work for most cases.
Not sure if it should be more careful about specifically only removing image and video extensions but I thought that might be over-complicating it.
Fixes #46