]> git.mxchange.org Git - friendica.git/commitdiff
Fix over-aggressive lowercasing of url, title, image, and preview fields
authorHank Grabowski <hankgrabowski@gmail.com>
Sun, 19 Mar 2023 01:52:53 +0000 (21:52 -0400)
committerHank Grabowski <hankgrabowski@gmail.com>
Sun, 19 Mar 2023 01:52:53 +0000 (21:52 -0400)
view/js/linkPreview.js

index 293020bc820cde6ebc9c3faa268c9a55c8186362..e0ce0f64f5d66a2e6f8305134c47f3f94d2a005f 100644 (file)
 
                        matches = attributes.match(/url='([\s\S]*?)'/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               url = matches[1].toLowerCase();
+                               url = matches[1];
                        }
 
                        matches = attributes.match(/url="([\s\S]*?)"/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               url = matches[1].toLowerCase();
+                               url = matches[1];
                        }
 
                        if(url !== '') {
 
                        matches = attributes.match(/title='([\s\S]*?)'/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               title = matches[1].toLowerCase();
+                               title = trim(matches[1]);
                        }
 
                        matches = attributes.match(/title="([\s\S]*?)"/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               title = matches[1].toLowerCase();
+                               title = trim(matches[1]);
                        }
 
                        if (title !== '') {
 
                        matches = attributes.match(/image='([\s\S]*?)'/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               image = matches[1].toLowerCase();
+                               image = trim(matches[1]);
                        }
 
                        matches = attributes.match(/image="([\s\S]*?)"/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               image = matches[1].toLowerCase();
+                               image = trim(matches[1]);
                        }
 
                        if (image !== '') {
 
                        matches = attributes.match(/preview='([\s\S]*?)'/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               preview = matches[1].toLowerCase();
+                               preview = trim(matches[1]);
                        }
 
                        matches = attributes.match(/preview="([\s\S]*?)"/im);
                        if (matches !== null && typeof matches[1] !== 'undefined') {
-                               preview = matches[1].toLowerCase();
+                               preview = trim(matches[1]);
                        }
 
                        if (preview !== '') {