code
stringlengths 14
2.05k
| label
int64 0
1
| programming_language
stringclasses 7
values | cwe_id
stringlengths 6
14
| cwe_name
stringlengths 5
98
⌀ | description
stringlengths 36
379
⌀ | url
stringlengths 36
48
⌀ | label_name
stringclasses 2
values |
---|---|---|---|---|---|---|---|
success: function(productUnit, status) {
if (status == "success") {
/* Change the product Price */
$(selector).closest("tr").find(".productPurchasePrice").val(productUnit.pp);
$(selector).closest("tr").find(".productMainPurchasePrice").val(productUnit.pp);
/* Calculate all data */
self.calculateEachProduct(selector);
self.grandTotal();
}
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
success: function(productUnit, status) {
if (status == "success") {
/* Change the product Price */
$(selector).closest("tr").find(".productPurchasePrice").val(productUnit.pp);
$(selector).closest("tr").find(".productMainPurchasePrice").val(productUnit.pp);
/* Calculate all data */
self.calculateEachProduct(selector);
self.grandTotal();
}
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
isGivenDiscountPermitted: function(selector) {
var totalAmount = $(".totalAmount").text();
var orderDiscount = $(selector).val();
if( get_options("maxDiscount") != "" ) { // If the current biller set a max discount
var maxDiscountAmount = totalAmount - BMS.FUNCTIONS.calculateDiscount(totalAmount, get_options("maxDiscount"));
var givenDiscountAmount = totalAmount - BMS.FUNCTIONS.calculateDiscount(totalAmount, orderDiscount);
// In case of return/ negative value
// -2 is greater then -4
// So we are converting all negative value to abs
return Math.abs(maxDiscountAmount) >= Math.abs(givenDiscountAmount);
} else {
return true;
}
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
isGivenDiscountPermitted: function(selector) {
var totalAmount = $(".totalAmount").text();
var orderDiscount = $(selector).val();
if( get_options("maxDiscount") != "" ) { // If the current biller set a max discount
var maxDiscountAmount = totalAmount - BMS.FUNCTIONS.calculateDiscount(totalAmount, get_options("maxDiscount"));
var givenDiscountAmount = totalAmount - BMS.FUNCTIONS.calculateDiscount(totalAmount, orderDiscount);
// In case of return/ negative value
// -2 is greater then -4
// So we are converting all negative value to abs
return Math.abs(maxDiscountAmount) >= Math.abs(givenDiscountAmount);
} else {
return true;
}
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
BMS.ORDER.productQntCheck = function(selector, event) {
// Count Sub total for each product.
var netSalesPrice = $(selector).closest("tr").find(".netSalesPrice").val();
var Quantity = $(selector).val();
var Discount = $(selector).closest("tr").find(".productDiscount").val();
var SubtotalRow = $(selector).closest("tr").find("td.subtotalCol");
// If the product quantity less then 1 then throw an error
if(Quantity == 0) {
// Display the error message
Swal.fire({
title: "Error!",
text: "Product qunatity can not be zero (0)",
icon: "error"
});
// Set product quantity 1
$(selector).val(1);
Quantity = 1;
}
// Display Subtotal for each product
$(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * Quantity).toFixed(2));
// Call the grand total
this.grandTotal();
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
BMS.ORDER.productQntCheck = function(selector, event) {
// Count Sub total for each product.
var netSalesPrice = $(selector).closest("tr").find(".netSalesPrice").val();
var Quantity = $(selector).val();
var Discount = $(selector).closest("tr").find(".productDiscount").val();
var SubtotalRow = $(selector).closest("tr").find("td.subtotalCol");
// If the product quantity less then 1 then throw an error
if(Quantity == 0) {
// Display the error message
Swal.fire({
title: "Error!",
text: "Product qunatity can not be zero (0)",
icon: "error"
});
// Set product quantity 1
$(selector).val(1);
Quantity = 1;
}
// Display Subtotal for each product
$(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * Quantity).toFixed(2));
// Call the grand total
this.grandTotal();
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
getListByGeneric: function(genericName) {
/**
* Get Product list by
* initializing the select2 with default option
*
* Arguments: Selector, option value, Option text
*
*/
BMS.fn.select2("#productGenericFilter", genericName, genericName);
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
getListByGeneric: function(genericName) {
/**
* Get Product list by
* initializing the select2 with default option
*
* Arguments: Selector, option value, Option text
*
*/
BMS.fn.select2("#productGenericFilter", genericName, genericName);
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep.
});
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep.
});
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
unit: $(selector).closest("tr").find(".productItemUnit").val()
}, product => {
if(product["error"] !== undefined && product["error"] === true) {
$(that).val(product.stq); // Set the product quantity with Stock Quantity
Quantity = product.stq;
// Display the error message
Swal.fire({
title: "Error!",
text: product["msg"],
icon: "error"
});
}
// Check if product[0] isset, if not the use direct product
// Because If there is any error then the product details come with the error
var product = product[0] ? product[0] : product;
// change product background color while changing qty and when out of stock
if(product.so) {
$(selector).closest("tr").css("background-color", "pink");
} else {
$(selector).closest("tr").css("background-color", "white");
}
// Display Subtotal for each product
$(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * Quantity).toFixed(2));
// Update the packet
var packet = 0;
if(Number(product.pq) > 0) {
packet = (Quantity / Number(product.pq)).toFixed(2);
}
packetSelector.val( packet );
// Call the grand total
this.grandTotal();
});
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
unit: $(selector).closest("tr").find(".productItemUnit").val()
}, product => {
if(product["error"] !== undefined && product["error"] === true) {
$(that).val(product.stq); // Set the product quantity with Stock Quantity
Quantity = product.stq;
// Display the error message
Swal.fire({
title: "Error!",
text: product["msg"],
icon: "error"
});
}
// Check if product[0] isset, if not the use direct product
// Because If there is any error then the product details come with the error
var product = product[0] ? product[0] : product;
// change product background color while changing qty and when out of stock
if(product.so) {
$(selector).closest("tr").css("background-color", "pink");
} else {
$(selector).closest("tr").css("background-color", "white");
}
// Display Subtotal for each product
$(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * Quantity).toFixed(2));
// Update the packet
var packet = 0;
if(Number(product.pq) > 0) {
packet = (Quantity / Number(product.pq)).toFixed(2);
}
packetSelector.val( packet );
// Call the grand total
this.grandTotal();
});
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
error: function() {
returnData("");
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
error: function() {
returnData("");
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
processResults: function (data) {
return {
results: data
};
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
processResults: function (data) {
return {
results: data
};
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
multiDatePicker: function({selector=".multiDatePicker", format="yyyy-mm-dd"}="") {
$(selector).datepicker({
multidate: true,
multidateSeparator: ", ",
format: format,
todayHighlight: true
});
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
multiDatePicker: function({selector=".multiDatePicker", format="yyyy-mm-dd"}="") {
$(selector).datepicker({
multidate: true,
multidateSeparator: ", ",
format: format,
todayHighlight: true
});
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
printPage: function(sURL, event, afterPrintOrCancel= function(){}) { | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
printPage: function(sURL, event, afterPrintOrCancel= function(){}) { | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
noResults: function() {
return noResults;
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
noResults: function() {
return noResults;
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
notification.onclick = function() {
window.focus();
this.close();
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
notification.onclick = function() {
window.focus();
this.close();
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
'All' : [moment(0), moment().subtract('year').endOf('day')],
}
});
// Apply the date
$(selector).on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format(format) + ' - ' + picker.endDate.format(format));
});
// clear the date
$(selector).on('cancel.daterangepicker', function(ev, picker){
$(this).val('');
});
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
'All' : [moment(0), moment().subtract('year').endOf('day')],
}
});
// Apply the date
$(selector).on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format(format) + ' - ' + picker.endDate.format(format));
});
// clear the date
$(selector).on('cancel.daterangepicker', function(ev, picker){
$(this).val('');
});
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer);
toast.addEventListener('mouseleave', Swal.resumeTimer);
this.play("beep");
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer);
toast.addEventListener('mouseleave', Swal.resumeTimer);
this.play("beep");
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
getCookie: function(name) {
var cookie = decodeURIComponent(`; ${document.cookie}`).split(`; ${name}=`);
if(cookie.length > 1) return cookie[1].split("; ")[0];
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
getCookie: function(name) {
var cookie = decodeURIComponent(`; ${document.cookie}`).split(`; ${name}=`);
if(cookie.length > 1) return cookie[1].split("; ")[0];
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
send: function(msg, toUserId) {
wss.send(JSON.stringify({
"type" : "message",
"toUser" : toUserId,
"msg" : msg
}));
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
send: function(msg, toUserId) {
wss.send(JSON.stringify({
"type" : "message",
"toUser" : toUserId,
"msg" : msg
}));
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
datePicker: function({selector=".datePicker", format="YYYY-MM-DD", timePicker= false}="") {
$(selector).daterangepicker({
autoUpdateInput: false,
singleDatePicker: true,
showDropdowns: true,
timePicker: timePicker,
timePicker24Hour: true,
autoApply: true,
parentEl: "div.dynamic-container",
drops: "auto",
locale:{
format: format,
cancelLabel: 'Clear'
}
});
// Apply the date
$(selector).on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format(format));
});
// clear the date
$(selector).on('cancel.daterangepicker', function(ev, picker){
$(this).val('');
});
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
datePicker: function({selector=".datePicker", format="YYYY-MM-DD", timePicker= false}="") {
$(selector).daterangepicker({
autoUpdateInput: false,
singleDatePicker: true,
showDropdowns: true,
timePicker: timePicker,
timePicker24Hour: true,
autoApply: true,
parentEl: "div.dynamic-container",
drops: "auto",
locale:{
format: format,
cancelLabel: 'Clear'
}
});
// Apply the date
$(selector).on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format(format));
});
// clear the date
$(selector).on('cancel.daterangepicker', function(ev, picker){
$(this).val('');
});
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
unit: $(selector).val()
}, products => {
// Change the sale price on unit change
$(selector).closest("tr").find(".productSalePrice").val(products[0]["sp"]);
});
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
unit: $(selector).val()
}, products => {
// Change the sale price on unit change
$(selector).closest("tr").find(".productSalePrice").val(products[0]["sp"]);
});
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
messageTop: function() {
// If the dt exprot message define then append it
if($("#DtExportTopMessage").html() !== undefined) {
return $("#DtExportTopMessage").html();
} else {
return "<h2 class='text-center'>" + document.title + "</h2><br/> <p class='text-center'> <strong>Printed On: </strong> "+ date +" </p> <br/>";
}
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
messageTop: function() {
// If the dt exprot message define then append it
if($("#DtExportTopMessage").html() !== undefined) {
return $("#DtExportTopMessage").html();
} else {
return "<h2 class='text-center'>" + document.title + "</h2><br/> <p class='text-center'> <strong>Printed On: </strong> "+ date +" </p> <br/>";
}
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
peerconnection.onaddstream = function (e) {
// set remote audio stream (to listen to remote audio)
// remoteAudio is <audio> element on pag
remoteAudio.srcObject = e.stream;
remoteAudio.play();
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
peerconnection.onaddstream = function (e) {
// set remote audio stream (to listen to remote audio)
// remoteAudio is <audio> element on pag
remoteAudio.srcObject = e.stream;
remoteAudio.play();
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
});
// Pause Ring
BMS.fn.pause();
// Stop Timer
BMS.fn.stopTimer(window.timer);
$("#status").html(`${caller} is disconnected`).show();
$("#timer").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(500).fadeIn(500);
// disable the number search and hangButton
$("#hangButton").prop("disabled", true);
// Show the feedback tab
$('.nav-tabs a[href="#tab_feedback"]').tab('show');
// Stop the phone
phone.stop();
}
// Complete the session
completeSession();
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
});
// Pause Ring
BMS.fn.pause();
// Stop Timer
BMS.fn.stopTimer(window.timer);
$("#status").html(`${caller} is disconnected`).show();
$("#timer").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(500).fadeIn(500);
// disable the number search and hangButton
$("#hangButton").prop("disabled", true);
// Show the feedback tab
$('.nav-tabs a[href="#tab_feedback"]').tab('show');
// Stop the phone
phone.stop();
}
// Complete the session
completeSession();
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
var completeSession = function(){
session = null;
// Reset the mute and holde button
$("#muteCall, #holdCall").show();
$("#unholdCall, #unmuteCall").hide();
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
var completeSession = function(){
session = null;
// Reset the mute and holde button
$("#muteCall, #holdCall").show();
$("#unholdCall, #unmuteCall").hide();
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
session.sendDTMF = function(tone){
dtmfSender.insertDTMF(tone);
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
session.sendDTMF = function(tone){
dtmfSender.insertDTMF(tone);
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
"text": $("#csSmsText").val()
},
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
}
});
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
"text": $("#csSmsText").val()
},
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
}
});
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function dial(number) {
if( phone.isConnected() ) {
// Disable input filed after dial
$(".numberSearch").prop("disabled", true);
$(".number-dialer-div .input-group-addon").addClass("disable-number-dialer-div");
// BMS.fn.play("outgoing_call", true);
session = phone.call( number.trim() , callOptions);
$("#status").html(`Call is being send to ${number}...`).show();
// hide the call button and show the hang button
$("#callButton, #hangButton").toggle();
// Show the caller details
showCallerDetails(caller);
// Empty the feedback area and remove previous fired for savings
$("#callFeedback, #feedbackReviewer").val("");
$(document).off("change", "#callFeedback, #feedbackReviewer");
// Hide the suggestion number if it is shown
$(".suggestion-numbers").html("").hide();
} else {
$("#status").html(`<div style="font-size: 16px;" class='alert alert-danger'>Sorry! The signaling server is disconnected.</div>`).show();
}
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function dial(number) {
if( phone.isConnected() ) {
// Disable input filed after dial
$(".numberSearch").prop("disabled", true);
$(".number-dialer-div .input-group-addon").addClass("disable-number-dialer-div");
// BMS.fn.play("outgoing_call", true);
session = phone.call( number.trim() , callOptions);
$("#status").html(`Call is being send to ${number}...`).show();
// hide the call button and show the hang button
$("#callButton, #hangButton").toggle();
// Show the caller details
showCallerDetails(caller);
// Empty the feedback area and remove previous fired for savings
$("#callFeedback, #feedbackReviewer").val("");
$(document).off("change", "#callFeedback, #feedbackReviewer");
// Hide the suggestion number if it is shown
$(".suggestion-numbers").html("").hide();
} else {
$("#status").html(`<div style="font-size: 16px;" class='alert alert-danger'>Sorry! The signaling server is disconnected.</div>`).show();
}
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
peerconnection.onaddstream = function (e) {
// set remote audio stream (to listen to remote audio)
// remoteAudio is <audio> element on pag
remoteAudio.srcObject = e.stream;
remoteAudio.play();
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
peerconnection.onaddstream = function (e) {
// set remote audio stream (to listen to remote audio)
// remoteAudio is <audio> element on pag
remoteAudio.srcObject = e.stream;
remoteAudio.play();
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
});
// Show the call dailer after session end
$("#callDailer").show();
// Hide call Received
$("#callReceiver").hide();
// Pause Ring
BMS.fn.pause();
// Show the call button
$("#callButton").show();
// Hide the end button
$("#hangButton").hide();
// Stop Timer
BMS.fn.stopTimer(window.timer);
$("#status").html(`Dail a number!`);
// clear case search list
$(".caseList input[type=search]").val('');
$(".caseList input[type=search]").trigger("keyup");
$("#timer").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(500).fadeIn(500, function() {
// Reset and hide the timer
$("#timer").html("00:00:00");
$("#timer").hide();
});
}
// Complete the session
completeSession();
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
});
// Show the call dailer after session end
$("#callDailer").show();
// Hide call Received
$("#callReceiver").hide();
// Pause Ring
BMS.fn.pause();
// Show the call button
$("#callButton").show();
// Hide the end button
$("#hangButton").hide();
// Stop Timer
BMS.fn.stopTimer(window.timer);
$("#status").html(`Dail a number!`);
// clear case search list
$(".caseList input[type=search]").val('');
$(".caseList input[type=search]").trigger("keyup");
$("#timer").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(500).fadeIn(500, function() {
// Reset and hide the timer
$("#timer").html("00:00:00");
$("#timer").hide();
});
}
// Complete the session
completeSession();
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000),
status: "Answered"
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
var completeSession = function(){
session = null;
// Reset the mute and holde button
$("#muteCall, #holdCall").show();
$("#unholdCall, #unmuteCall").hide();
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
var completeSession = function(){
session = null;
// Reset the mute and holde button
$("#muteCall, #holdCall").show();
$("#unholdCall, #unmuteCall").hide();
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
session.sendDTMF = function(tone){
dtmfSender.insertDTMF(tone);
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
session.sendDTMF = function(tone){
dtmfSender.insertDTMF(tone);
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
"text": $("#csSmsText").val()
},
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
}
});
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
"text": $("#csSmsText").val()
},
success: function(data, status) {
if(status = "success" && data === "1") {
// Success Altert
BMS.fn.alertSuccess("SMS successfully sent.", false);
// Make empty the sms box
$("#csSmsText").val("");
} else {
BMS.fn.alertError("SMS faild to send.");
}
}
});
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
success: function (data, status) {
if (status == "success") {
//Remove the loading icon from button
$(submitter).html("Printing...");
var saleStatus = JSON.parse(data);
// Redirect to sale invoice print page
if (saleStatus["saleStatus"] === "success") {
BMS.MAIN.printPage(full_website_address + "/invoice-print/?invoiceType=posSale&id=" + saleStatus["salesId"], event, function () {
// Hide the payment modal
$('#payment').modal('hide');
// Clear POS Screen
BMS.POS.clearScreen();
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
});
} else {
$("#posErrorMsg").html('<div class="alert alert-danger">' + saleStatus["msg"] + '</div>');
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
}
}
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
success: function (data, status) {
if (status == "success") {
//Remove the loading icon from button
$(submitter).html("Printing...");
var saleStatus = JSON.parse(data);
// Redirect to sale invoice print page
if (saleStatus["saleStatus"] === "success") {
BMS.MAIN.printPage(full_website_address + "/invoice-print/?invoiceType=posSale&id=" + saleStatus["salesId"], event, function () {
// Hide the payment modal
$('#payment').modal('hide');
// Clear POS Screen
BMS.POS.clearScreen();
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
});
} else {
$("#posErrorMsg").html('<div class="alert alert-danger">' + saleStatus["msg"] + '</div>');
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
}
}
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep.
});
return;
}
// Add loading icon in the button after click.
$(submitter).html("Submit <i class='fa fa-spin fa-refresh'></i>");
var formData = new FormData(this); // Get all form data and store into formData
// Append the button value with form data
formData.append(submitter.name, submitter.value);
// disable submit button untile ajax request complete
$("#payment").find("button").prop("disabled", true);
$.ajax({
url: full_website_address + "/info/?module=pos",
type: "post",
data: formData,
cache: false,
contentType: false,
processData: false,
success: function (data, status) {
if (status == "success") {
//Remove the loading icon from button
$(submitter).html("Printing...");
var saleStatus = JSON.parse(data);
// Redirect to sale invoice print page
if (saleStatus["saleStatus"] === "success") {
BMS.MAIN.printPage(full_website_address + "/invoice-print/?invoiceType=posSale&id=" + saleStatus["salesId"], event, function () {
// Hide the payment modal
$('#payment').modal('hide');
// Clear POS Screen
BMS.POS.clearScreen();
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
});
} else {
$("#posErrorMsg").html('<div class="alert alert-danger">' + saleStatus["msg"] + '</div>');
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
}
}
}
});
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep.
});
return;
}
// Add loading icon in the button after click.
$(submitter).html("Submit <i class='fa fa-spin fa-refresh'></i>");
var formData = new FormData(this); // Get all form data and store into formData
// Append the button value with form data
formData.append(submitter.name, submitter.value);
// disable submit button untile ajax request complete
$("#payment").find("button").prop("disabled", true);
$.ajax({
url: full_website_address + "/info/?module=pos",
type: "post",
data: formData,
cache: false,
contentType: false,
processData: false,
success: function (data, status) {
if (status == "success") {
//Remove the loading icon from button
$(submitter).html("Printing...");
var saleStatus = JSON.parse(data);
// Redirect to sale invoice print page
if (saleStatus["saleStatus"] === "success") {
BMS.MAIN.printPage(full_website_address + "/invoice-print/?invoiceType=posSale&id=" + saleStatus["salesId"], event, function () {
// Hide the payment modal
$('#payment').modal('hide');
// Clear POS Screen
BMS.POS.clearScreen();
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
});
} else {
$("#posErrorMsg").html('<div class="alert alert-danger">' + saleStatus["msg"] + '</div>');
// enable submit button after ajax request complete
$("#payment").find("button").prop("disabled", false);
}
}
}
});
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
reader.onload = function (e) {
$(that).css("color", "green");
$(that).closest(".imageContainer").find('.image_preview').css("display", "block");
$(that).closest(".imageContainer").find('.previewing').attr('src', e.target.result);
//$(that).closest(".imageContainer").find('.previewing').attr('width', 'auto');
//$(that).closest(".imageContainer").find('.previewing').attr('height', '100%');
}; | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
reader.onload = function (e) {
$(that).css("color", "green");
$(that).closest(".imageContainer").find('.image_preview').css("display", "block");
$(that).closest(".imageContainer").find('.previewing').attr('src', e.target.result);
//$(that).closest(".imageContainer").find('.previewing').attr('width', 'auto');
//$(that).closest(".imageContainer").find('.previewing').attr('height', '100%');
}; | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
didOpen: function () {
BMS.fn.play("warning");
}, | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
didOpen: function () {
BMS.fn.play("warning");
}, | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function dropDownFixPosition(button, dropdown) {
var dropDownTop = button.offset().top + button.outerHeight();
dropdown.css('top', dropDownTop + "px");
dropdown.css('left', button.offset().left - 100 + "px");
dropdown.css('position', "absolute");
dropdown.css('width', dropdown.width());
dropdown.css('heigt', dropdown.height());
dropdown.css('display', 'block');
dropdown.appendTo('.dynamic-container');
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function dropDownFixPosition(button, dropdown) {
var dropDownTop = button.offset().top + button.outerHeight();
dropdown.css('top', dropDownTop + "px");
dropdown.css('left', button.offset().left - 100 + "px");
dropdown.css('position', "absolute");
dropdown.css('width', dropdown.width());
dropdown.css('heigt', dropdown.height());
dropdown.css('display', 'block');
dropdown.appendTo('.dynamic-container');
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
beforeSend: function (xhr) {
xhr.setRequestHeader("X-CSRF-TOKEN", xCsrfToken);
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
beforeSend: function (xhr) {
xhr.setRequestHeader("X-CSRF-TOKEN", xCsrfToken);
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
author: $("#productAuthorFilter").val(),
});
}); | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
author: $("#productAuthorFilter").val(),
});
}); | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep.
});
// Remove the deleted elements
if(removeParent !== undefined) {
$(that).closest(removeParent).hide('fast');
}
// Reloade the Datatable
$('#dataTableWithAjax').DataTable().ajax.reload(null, false);
$('#dataTableWithAjaxExtend').DataTable().ajax.reload(null, false);
}
);
}
}) | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep.
});
// Remove the deleted elements
if(removeParent !== undefined) {
$(that).closest(removeParent).hide('fast');
}
// Reloade the Datatable
$('#dataTableWithAjax').DataTable().ajax.reload(null, false);
$('#dataTableWithAjaxExtend').DataTable().ajax.reload(null, false);
}
);
}
}) | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function format_number(
number,
decimalPlaces = null,
decimalSeparator = "",
thousandSeparator = ""
) {
var number = Number(number);
var decimalPlaces = empty(decimalPlaces) ? get_options("decimalPlaces") : decimalPlaces;
var decimalSeparator = empty(decimalSeparator) ? get_options("decimalSeparator") : decimalSeparator;
var thousandSeparator = empty(thousandSeparator) ? get_options("thousandSeparator") : thousandSeparator;
/** Regex taken from VisioN: https://stackoverflow.com/a/14428340 */
var re = '\\d(?=(\\d{' + (3) + '})+' + (decimalPlaces > 0 ? '\\D' : '$') + ')',
num = number.toFixed(Math.max(0, ~~decimalPlaces));
var formatedNumber = (decimalSeparator ? num.replace('.', decimalSeparator) : num).replace(new RegExp(re, 'g'), '$&' + (thousandSeparator || ','));
return formatedNumber;
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function format_number(
number,
decimalPlaces = null,
decimalSeparator = "",
thousandSeparator = ""
) {
var number = Number(number);
var decimalPlaces = empty(decimalPlaces) ? get_options("decimalPlaces") : decimalPlaces;
var decimalSeparator = empty(decimalSeparator) ? get_options("decimalSeparator") : decimalSeparator;
var thousandSeparator = empty(thousandSeparator) ? get_options("thousandSeparator") : thousandSeparator;
/** Regex taken from VisioN: https://stackoverflow.com/a/14428340 */
var re = '\\d(?=(\\d{' + (3) + '})+' + (decimalPlaces > 0 ? '\\D' : '$') + ')',
num = number.toFixed(Math.max(0, ~~decimalPlaces));
var formatedNumber = (decimalSeparator ? num.replace('.', decimalSeparator) : num).replace(new RegExp(re, 'g'), '$&' + (thousandSeparator || ','));
return formatedNumber;
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function sumInputs(input) {
var sum = 0;
$(input).each(function(){
sum += $(this).val() === "" ? 0 : parseFloat( $(this).val() );
});
return sum;
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function sumInputs(input) {
var sum = 0;
$(input).each(function(){
sum += $(this).val() === "" ? 0 : parseFloat( $(this).val() );
});
return sum;
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function backToPurchaseList() {
/** show the customer purchase list */
$("#showPurchaseList").show();
/** Hide the purchase product list */
$("#showPurchaseProductList").hide();
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function backToPurchaseList() {
/** show the customer purchase list */
$("#showPurchaseList").show();
/** Hide the purchase product list */
$("#showPurchaseProductList").hide();
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function to_money(
number,
decimalPlaces = null,
decimalSeparator = "",
thousandSeparator = "",
currencySymbol = "",
currencySymbolPosition = ""
) {
var currencySymbol = empty(currencySymbol) ? get_options("currencySymbol") : currencySymbol;
var currencySymbolPosition = empty(currencySymbolPosition) ? get_options("currencySymbolPosition") : currencySymbolPosition;
var formatedNumber = format_number(number, decimalPlaces = decimalPlaces, decimalSeparator = decimalSeparator, thousandSeparator = thousandSeparator);
if( !empty(currencySymbolPosition) && currencySymbolPosition.toLowerCase === "right" ) {
formatedNumber = formatedNumber + " " + currencySymbol;
} else {
formatedNumber = currencySymbol + " " + formatedNumber;
}
return formatedNumber;
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function to_money(
number,
decimalPlaces = null,
decimalSeparator = "",
thousandSeparator = "",
currencySymbol = "",
currencySymbolPosition = ""
) {
var currencySymbol = empty(currencySymbol) ? get_options("currencySymbol") : currencySymbol;
var currencySymbolPosition = empty(currencySymbolPosition) ? get_options("currencySymbolPosition") : currencySymbolPosition;
var formatedNumber = format_number(number, decimalPlaces = decimalPlaces, decimalSeparator = decimalSeparator, thousandSeparator = thousandSeparator);
if( !empty(currencySymbolPosition) && currencySymbolPosition.toLowerCase === "right" ) {
formatedNumber = formatedNumber + " " + currencySymbol;
} else {
formatedNumber = currencySymbol + " " + formatedNumber;
}
return formatedNumber;
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function isJson(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function isJson(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function sendBulkSMS(url) {
var table = $('#dataTableWithAjaxExtend').DataTable();
//var data = table.columns( 0 ).data();
var rows = table.rows({ selected: true }).indexes();
var data = table.cells(rows, 0).data();
var number = [];
$.each(data, function (key, num) {
if (num != "" || num != null || num != 'NULL' || num != 0 || num != '0') {
number.push(num);
}
});
$("#modalDefault").modal('show').find('.modal-content').load(url + encodeURI(number.join()));
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function sendBulkSMS(url) {
var table = $('#dataTableWithAjaxExtend').DataTable();
//var data = table.columns( 0 ).data();
var rows = table.rows({ selected: true }).indexes();
var data = table.cells(rows, 0).data();
var number = [];
$.each(data, function (key, num) {
if (num != "" || num != null || num != 'NULL' || num != 0 || num != '0') {
number.push(num);
}
});
$("#modalDefault").modal('show').find('.modal-content').load(url + encodeURI(number.join()));
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |
function get_options(name) {
return localStorage.getItem(name);
} | 1 | JavaScript | CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. | https://cwe.mitre.org/data/definitions/829.html | safe |
function get_options(name) {
return localStorage.getItem(name);
} | 1 | JavaScript | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | safe |