security innerHTML

parent d6233e65
......@@ -4,7 +4,7 @@
"description" : "Create shortened URL from a long URL",
"homepage_url": "https://url.itunix.eu/",
"version": "1.2.2",
"version": "1.2.3",
"icons": {
"48": "icons/icon-48.png",
......
......@@ -21,7 +21,7 @@
<fieldset id="short_menu" style="display: none;">
<div class="alert alert-dismissible alert-secondary">
<button type="button" class="close" data-dismiss="alert" id="clearapi" style="display: none;">&times;</button>
<strong id="info">Paste an URL in text box and click Shorten.</strong>
<span id="info">Paste an URL in text box and click Shorten.</span>
</div>
<div class="input-group mb-3 input-group-lg">
<input type="text" class="form-control" type="text" placeholder="Paste a link to shorten it" autocomplete="off" autocorrect="off" autocapitalize="off" id="urltext" aria-describedby="urlclick">
......
......@@ -44,8 +44,12 @@ function shortUrl(apikey, long_url) {
document.getElementById("shorturl").setAttribute("style","display:block;text-align: center;font-weight: bold;");
document.getElementById("info").innerHTML = "Link is copied to clipboard";
copyToClipboard();
} else {
document.getElementById("info").innerHTML = this.responseText;
}
if (this.status == 422) {
document.getElementById("info").innerHTML = "No valid entries";
}
if (this.status == 401) {
document.getElementById("info").innerHTML = "No valid API key";
}
}
var apiserver = localStorage.getItem('apiserver');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment