: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php namespace flow\social;
if ( ! defined( 'WPINC' ) ) die;
* @author Looks Awesome <email@looks-awesome.com>
* @link http://looks-awesome.com
* @copyright 2014-2018 Looks Awesome
class LASocialException extends \Exception {
* LASocialException constructor.
public function __construct( $message = '', $options = array(), $problem = null) {
parent::__construct($message);
$this->options = $options;
$this->problem = $problem;
public function __toString() {
$text = parent::__toString();
if (!is_null($this->problem)){
$text .= "\n Problem object:\n";
$text .= print_r($this->problem, true);
public function setMessage( $message ) {
$this->message = $message;
public function getSocialError(){
$message = $this->filter_error_message($this->getMessage());
if (!empty($this->getMessage())){
$this->options['message'] = $message;
public function getProblem() {
private function filter_error_message($message){
if (sizeof($message) > 0 && isset($message[0]['msg'])){
return utf8_encode(stripslashes(htmlspecialchars($message[0]['msg'], ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8')));
return stripslashes(htmlspecialchars($message, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'));