Nested slider sanitize object using stripslashes.
That occurs an error.
This error occurs when image used into slider is replaced by another plugin named Enable Media Replace (By ShortPixel).
But this is not this plugin problem.
Problem is object sanitization.
- Create nested slider.
- Add image to slide and save.
- Display page with slider.
- Replace image into Media Library using Enable Media Replace plugin (use the same image You upload earlier).
- Refresh page with slider.
- Error will display.
I use custom slider options:
{
"type": "slide",
"autoplay": false,
"speed": 400,
"perPage": 1,
"perMove": 1,
"gap": 15,
"pagination": true,
"reducedMotion": {
"autoplay": "pause",
"speed": 400,
"rewindSpeed": 400
},
"breakpoints": {
"576": {
"perPage": 1,
"perMove": 1
},
"768": {
"perPage": 1,
"perMove": 1
},
"992": {
"perPage": 1,
"perMove": 1
},
"1200": {
"perPage": 1,
"perMove": 1
}
}
}
Fatal error: Uncaught TypeError: stripslashes(): Argument #1 ($string) must be of type string, stdClass given in /public_html/wp-content/themes/bricks/includes/elements/slider-nested.php:1324
This part of code occurs problem with object sanitization.
trim( stripslashes( $settings['options'] )
Stripslashes function is executing on object:
object(stdClass)#28077 (9) {
["type"]=>
string(5) "slide"
["autoplay"]=>
bool(false)
["speed"]=>
int(400)
["perPage"]=>
int(1)
["perMove"]=>
int(1)
["gap"]=>
int(15)
["pagination"]=>
bool(true)
["reducedMotion"]=>
object(stdClass)#26352 (3) {
["autoplay"]=>
string(5) "pause"
["speed"]=>
int(400)
["rewindSpeed"]=>
int(400)
}
["breakpoints"]=>
object(stdClass)#28080 (4) {
["576"]=>
object(stdClass)#26012 (2) {
["perPage"]=>
int(1)
["perMove"]=>
int(1)
}
["768"]=>
object(stdClass)#26018 (2) {
["perPage"]=>
int(1)
["perMove"]=>
int(1)
}
["992"]=>
object(stdClass)#26621 (2) {
["perPage"]=>
int(1)
["perMove"]=>
int(1)
}
["1200"]=>
object(stdClass)#26620 (2) {
["perPage"]=>
int(1)
["perMove"]=>
int(1)
}
}
}