[vlc-devel] [PATCH 2/4] lua/http: use correct mobile interface URL to generate QR code

Pierre Ynard linkfanel at yahoo.fr
Sat Aug 8 02:32:16 CEST 2020


This was not just hardcoded, it failed if the web interface was accessed
with a query string or a URL fragment for example.


diff --git a/share/lua/http/js/ui.js b/share/lua/http/js/ui.js
index 83e5c23..b81674a 100644
--- a/share/lua/http/js/ui.js
+++ b/share/lua/http/js/ui.js
@@ -100,7 +100,7 @@ $(function () {
         {
              return true;
         }
-        var urlimg = location.href + 'mobile.html';
+        var urlimg = $('#mobileintflink').prop('href');
         var codeimg = $('<img width="350" height="350" alt="qrcode"/>');
         codeimg.attr('src', 'https://chart.apis.google.com/chart?cht=qr&chs=350x350&chld=L&choe=UTF-8&chl=' + encodeURIComponent(urlimg));
         codeimg.dialog({width: 350, height: 350, title: 'QR-Code'});
-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."


More information about the vlc-devel mailing list