diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2022-05-23 20:10:59 +0300 |
---|---|---|
committer | Julien Veyssier <eneiluj@posteo.net> | 2022-05-23 20:13:06 +0300 |
commit | 1715a7cadf2c36f5d2af65f23b4afc31f13158c7 (patch) | |
tree | 0c8dc974e168b4c2558123af86f741f7bf738fdb /lib | |
parent | b95deb975414b44e953608aa89518cb0dfcaa17e (diff) |
move test, add comments for cleanup regexps
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/ImageService.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Service/ImageService.php b/lib/Service/ImageService.php index 7d047550a..901575355 100644 --- a/lib/Service/ImageService.php +++ b/lib/Service/ImageService.php @@ -485,6 +485,7 @@ class ImageService { // simple version with .+ between the brackets // '/\!\[.+\]\(text:\/\/image\?[^)]*imageFileName=([^)&]+)\)/', // complex version of php-markdown + // matches ![ANY_CONSIDERED_CORRECT_BY_PHP-MARKDOWN](text://image?ANYTHING&imageFileName=FILE_NAME) and captures FILE_NAME '/\!\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[\])*\])*\])*\])*\])*\])*\]\(text:\/\/image\?[^)]*imageFileName=([^)&]+)\)/', $content, $oldMatches, @@ -495,6 +496,7 @@ class ImageService { }, $oldMatches); $matches = []; + // matches ![ANY_CONSIDERED_CORRECT_BY_PHP-MARKDOWN](.attachments.DOCUMENT_ID/ANY_FILE_NAME) and captures FILE_NAME preg_match_all( '/\!\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[(?>[^\[\]]+|\[\])*\])*\])*\])*\])*\])*\]\(\.attachments\.'.$fileId.'\/([^)&]+)\)/', $content, |