Fossil SCM

Added quotes around the URLs passed to the browser for the ui command so that URL parameters containing an ampersand get passed on correctly.

stephan 2020-05-01 07:33 UTC checkin-without-checkout
Commit 126d34fb321c79871b00309917ec623321789bcaaca25d4aae431c3e298074d1
1 file changed +3 -3
+3 -3
--- src/main.c
+++ src/main.c
@@ -2812,17 +2812,17 @@
28122812
}
28132813
#else
28142814
zBrowser = db_get("web-browser", "open");
28152815
#endif
28162816
if( zIpAddr==0 ){
2817
- zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
2817
+ zBrowserCmd = mprintf("%s \"http://localhost:%%d/%s\" &",
28182818
zBrowser, zInitPage);
28192819
}else if( strchr(zIpAddr,':') ){
2820
- zBrowserCmd = mprintf("%s http://[%s]:%%d/%s &",
2820
+ zBrowserCmd = mprintf("%s \"http://[%s]:%%d/%s\" &",
28212821
zBrowser, zIpAddr, zInitPage);
28222822
}else{
2823
- zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
2823
+ zBrowserCmd = mprintf("%s \"http://%s:%%d/%s\" &",
28242824
zBrowser, zIpAddr, zInitPage);
28252825
}
28262826
}
28272827
if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
28282828
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
28292829
--- src/main.c
+++ src/main.c
@@ -2812,17 +2812,17 @@
2812 }
2813 #else
2814 zBrowser = db_get("web-browser", "open");
2815 #endif
2816 if( zIpAddr==0 ){
2817 zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
2818 zBrowser, zInitPage);
2819 }else if( strchr(zIpAddr,':') ){
2820 zBrowserCmd = mprintf("%s http://[%s]:%%d/%s &",
2821 zBrowser, zIpAddr, zInitPage);
2822 }else{
2823 zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
2824 zBrowser, zIpAddr, zInitPage);
2825 }
2826 }
2827 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2828 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2829
--- src/main.c
+++ src/main.c
@@ -2812,17 +2812,17 @@
2812 }
2813 #else
2814 zBrowser = db_get("web-browser", "open");
2815 #endif
2816 if( zIpAddr==0 ){
2817 zBrowserCmd = mprintf("%s \"http://localhost:%%d/%s\" &",
2818 zBrowser, zInitPage);
2819 }else if( strchr(zIpAddr,':') ){
2820 zBrowserCmd = mprintf("%s \"http://[%s]:%%d/%s\" &",
2821 zBrowser, zIpAddr, zInitPage);
2822 }else{
2823 zBrowserCmd = mprintf("%s \"http://%s:%%d/%s\" &",
2824 zBrowser, zIpAddr, zInitPage);
2825 }
2826 }
2827 if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
2828 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2829

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button