[vlc-commits] [Git][videolan/vlc][master] macosx: fixup user-provided URIs

Thomas Guillem (@tguillem) gitlab at videolan.org
Tue Aug 31 15:38:50 UTC 2021



Thomas Guillem pushed to branch master at VideoLAN / VLC


Commits:
cc6a5a73 by Marvin Scholz at 2021-08-31T14:58:03+00:00
macosx: fixup user-provided URIs

Fixup user-provided URIs, similar to what most browser nowadays do.

Fix #21661

- - - - -


1 changed file:

- modules/gui/macosx/windows/VLCOpenWindowController.m


Changes:

=====================================
modules/gui/macosx/windows/VLCOpenWindowController.m
=====================================
@@ -1009,9 +1009,20 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
                 mrlString = [mrlString stringByAppendingFormat: @":%i", port];
             }
         }
-    } else
+    } else {
         mrlString = [_netHTTPURLTextField stringValue];
 
+        // Fixup the user-provided URI
+        const char *orig_uri = [mrlString UTF8String];
+        if (orig_uri == NULL)
+            return;
+        char *fixed_uri = vlc_uri_fixup(orig_uri);
+        if (fixed_uri) {
+            mrlString = [[NSString alloc] initWithUTF8String:fixed_uri];
+            free(fixed_uri);
+        }
+    }
+
     [self setMRL: mrlString];
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cc6a5a7370467e7f0fb51578f06f68dfe19dca3b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cc6a5a7370467e7f0fb51578f06f68dfe19dca3b
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list