[vlc-commits] lua/http: use correct mobile interface URL to generate QR code

Pierre Ynard git at videolan.org
Tue Aug 18 16:58:18 CEST 2020


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Tue Aug 18 16:52:53 2020 +0200| [ddf1bc3cbaef16fd9bea3155d37683d94eeac01c] | committer: Pierre Ynard

lua/http: use correct mobile interface URL to generate QR code

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ddf1bc3cbaef16fd9bea3155d37683d94eeac01c
---

 share/lua/http/js/ui.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/lua/http/js/ui.js b/share/lua/http/js/ui.js
index 83e5c23294..b81674ab36 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'});



More information about the vlc-commits mailing list