|
Lines 578-586
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
| 578 |
|
578 |
|
| 579 |
function build_query(col, value){ |
579 |
function build_query(col, value){ |
| 580 |
|
580 |
|
| 581 |
// escape SQL special characters |
|
|
| 582 |
value = value.replace(/(\%|\_|\\)/g, "\\$1" ); |
| 583 |
|
| 584 |
var parts = []; |
581 |
var parts = []; |
| 585 |
var attributes = col.data.split(':'); |
582 |
var attributes = col.data.split(':'); |
| 586 |
for (var i=0;i<attributes.length;i++){ |
583 |
for (var i=0;i<attributes.length;i++){ |
|
Lines 591-596
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
| 591 |
value = value.replace(/^\^/, '').replace(/\$$/, ''); |
588 |
value = value.replace(/^\^/, '').replace(/\$$/, ''); |
| 592 |
criteria = "exact"; |
589 |
criteria = "exact"; |
| 593 |
} |
590 |
} |
|
|
591 |
else { |
| 592 |
// escape SQL special characters when search is not exact |
| 593 |
value = value.replace(/(\%|\_|\\)/g, "\\$1" ); |
| 594 |
} |
| 594 |
part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact' |
595 |
part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact' |
| 595 |
? value |
596 |
? value |
| 596 |
: {like: (['contains', 'ends_with'].indexOf(criteria) !== -1?'%':'') + value + (['contains', 'starts_with'].indexOf(criteria) !== -1?'%':'')}; |
597 |
: {like: (['contains', 'ends_with'].indexOf(criteria) !== -1?'%':'') + value + (['contains', 'starts_with'].indexOf(criteria) !== -1?'%':'')}; |
| 597 |
- |
|
|