cleanMultipleSlashes(json_decode($item->meta_value, true, JSON_UNESCAPED_SLASHES)); DB::table('give_formmeta') ->where('form_id', $item->form_id) ->where('meta_key', DonationFormMetaKeys::SETTINGS()->getValue()) ->update([ 'meta_value' => json_encode($settings), ]); } } /** * @inheritdoc */ public static function id() { return 'donation-forms-clean-multiple-slashes-on-db'; } /** * @inheritdoc */ public static function title() { return 'Clean multiple slashes in the formBuilderSettings meta value'; } /** * @inheritdoc */ public static function timestamp() { return strtotime('2023-11-20'); } /** * @since 3.2.0 */ public function cleanMultipleSlashes($var) { if (is_array($var)) { return array_map([$this, 'cleanMultipleSlashes'], $var); } else { return is_string($var) ? deslash($var) : $var; } } }