Browse code

URL-encode username for URL

Shane F. Carr authored on 30.12.2018 23:52:44
Showing 2 changed files

... ...
@@ -32,10 +32,10 @@
32 32
                         {% endif %}
33 33
                     </div><br />
34 34
                     {% if show_ssh_remote %}
35
-                    <input type="text" class="form-control{{ show_ssh_remote ? ' visible' }}" id="clone-input-ssh" value="git clone {{ ssh_port ? 'ssh://' }}{{ ssh_user }}{{ ssh_user ? '@' }}{{ ssh_host ? ssh_host : app.request.host }}:{{ ssh_port ? ssh_port ~ '/' : '' }}{{ ssh_url_subdir }}{{ repo }}">
35
+                    <input type="text" class="form-control{{ show_ssh_remote ? ' visible' }}" id="clone-input-ssh" value="git clone {{ ssh_port ? 'ssh://' }}{{ ssh_user | url_encode }}{{ ssh_user ? '@' }}{{ ssh_host ? ssh_host : app.request.host }}:{{ ssh_port ? ssh_port ~ '/' : '' }}{{ ssh_url_subdir }}{{ repo }}">
36 36
                     {% endif %}
37 37
                     {% if show_http_remote %}
38
-                    <input type="text" class="form-control{{ show_ssh_remote is empty and show_http_remote ? ' visible' }}" id="clone-input-http" value="git clone http{{ use_https ? 's' }}://{{ http_user }}{{ http_user ? '@' }}{{ http_host ? http_host : app.request.host }}/{{ http_url_subdir }}{{ repo }}">
38
+                    <input type="text" class="form-control{{ show_ssh_remote is empty and show_http_remote ? ' visible' }}" id="clone-input-http" value="git clone http{{ use_https ? 's' }}://{{ http_user | url_encode }}{{ http_user ? '@' }}{{ http_host ? http_host : app.request.host }}/{{ http_url_subdir }}{{ repo }}">
39 39
                     {% endif %}
40 40
                 </div>
41 41
             </div>
... ...
@@ -30,10 +30,10 @@
30 30
                         {% endif %}
31 31
                     </div><br />
32 32
                     {% if show_ssh_remote %}
33
-                    <input type="text" class="form-control{{ show_ssh_remote ? ' visible' }}" id="clone-input-ssh" value="git clone {{ ssh_port ? 'ssh://' }}{{ ssh_user }}{{ ssh_user ? '@' }}{{ ssh_host ? ssh_host : app.request.host }}:{{ ssh_port ? ssh_port ~ '/' : '' }}{{ ssh_url_subdir }}{{ repo }}">
33
+                    <input type="text" class="form-control{{ show_ssh_remote ? ' visible' }}" id="clone-input-ssh" value="git clone {{ ssh_port ? 'ssh://' }}{{ ssh_user | url_encode }}{{ ssh_user ? '@' }}{{ ssh_host ? ssh_host : app.request.host }}:{{ ssh_port ? ssh_port ~ '/' : '' }}{{ ssh_url_subdir }}{{ repo }}">
34 34
                     {% endif %}
35 35
                     {% if show_http_remote %}
36
-                    <input type="text" class="form-control{{ show_ssh_remote is empty and show_http_remote ? ' visible' }}" id="clone-input-http" value="git clone http{{ use_https ? 's' }}://{{ http_user }}{{ http_user ? '@' }}{{ http_host ? http_host : app.request.host }}/{{ http_url_subdir }}{{ repo }}">
36
+                    <input type="text" class="form-control{{ show_ssh_remote is empty and show_http_remote ? ' visible' }}" id="clone-input-http" value="git clone http{{ use_https ? 's' }}://{{ http_user | url_encode }}{{ http_user ? '@' }}{{ http_host ? http_host : app.request.host }}/{{ http_url_subdir }}{{ repo }}">
37 37
                     {% endif %}
38 38
                 </div>
39 39
             </div>