: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if (value === undefined || value === 'undefined' || value === null) {
serialize(id, empty, repeat) {
el = typeof id === 'string' ?api.LightBox.el.querySelector('#' + id):id;
const options = el.tfClass((repeat ? 'tb_lb_option_child' : 'tb_lb_option'));
for (let i = options.length - 1; i > -1; --i) {
let v = this.parseSettings(options[i], repeat);
if (v !== false && v.id && (empty === true || v.v !== '')) {
this.registerValidator('email', item => {
const v = typeof item === 'string' ? item : item.value.split(','),
pattern = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
for (let i = v.length - 1; i > -1; --i) {
if (!pattern.test(v[i])) {
this.registerValidator('row_anchor', item => {
v = v.replaceAll('#', '').replaceAll(' ', '').trim();
this.registerValidator('custom_css_id', (item,el) => {
v = v.replace(/[^a-zA-Z0-9\-\_]/g, '');
const items = doc.querySelectorAll('#' + v);
for (let i = items.length - 1; i > -1; --i) {
if (el!==items[i] && items[i].closest('.module_row') !== null) {
this.registerValidator('custom_css', item => {
v = v.replace(/\s\s+/g, ' ').split(' ');
for (let i = v.length - 1; i > -1; --i) {
v[i] = v[i].replace(/[^a-zA-Z0-9\s\-\_]/g, '');
v[i] = v[i].substring(1);
this.registerValidator('not_empty', item => {
return item.value.toString().trim() !== '';
registerValidator(type, fn) {
this._validators.set(type, fn);
return this._validators.get(type) || this._validators.get('not_empty');
const validate = form.tfClass('tb_must_validate'),
for (let i = len - 1; i > -1; --i) {
let item = validate[i].tfClass('tb_lb_option')[0],
validator=this.getValidator(validate[i].dataset.validation),
if (!item.classList.contains('tb_field_error')) {
let exist=item.parentNode.tfClass('tb_field_error_msg')[0],
el = exist || createElement('span'),
afterEl = item.tagName === 'SELECT' || item.classList.contains('tb_uploader_input')? item.parentNode : item,
msg=validate[i].dataset.errorMsg;
el.textContent = check === false ? (i18n[msg] || msg) : check;
item.classList.add('tb_field_error');
el.className = 'tb_field_error_msg';
item.classList.remove('tb_field_error');
for (let er = validate[i].tfClass('tb_field_error_msg'),j = er.length - 1; j > -1; --j) {
if (is_valid === false) {
const tab = api.LightBox.el.querySelector('a[data-id="' + form.id + '"]');
if (!tab.parentNode.classList.contains('current')) {
Themify.triggerEvent(tab, _CLICK_);
TF_Notification.showHide('error', i18n.lightBoxRequiredFields);
items = el.querySelectorAll('input,select,textarea');
for (let i = items.length - 1; i > -1; --i) {
let {type,value,id,tagName:tag} = items[i],
name = items[i].name || id;
if (name && type !== 'button' && type !== 'submit' && value !== '') {
if (items[i].classList.contains('wp-editor-area') && typeof tinyMCE !== 'undefined') {
let tiny = tinyMCE.get(id);
value = tiny.getContent().trim();
} else if (type === 'radio' || type === 'checkbox' || tag === 'select') {
if (items[i].hasAttribute('multiple')) {
for (let j = 0, options = items[i].children; j < options.length; ++j) {
if (options[j].selected) {
selected.push(options[j].value);
} else if (!items[i].checked) {
if (type === 'checkbox') {
})(tb_app, topThemify,topWindowDoc,topWindow,topBody,topBodyCl,_CLICK_,tb_app.Registry,ThemifyConstructor);