whoami7 - Manager
:
/
home
/
techyfnq
/
www
/
wp-content
/
plugins
/
site-reviews
/
plugin
/
Defaults
/
Upload File:
files >> //home/techyfnq/www/wp-content/plugins/site-reviews/plugin/Defaults/SiteReviewsFormDefaults.php
<?php namespace GeminiLabs\SiteReviews\Defaults; use GeminiLabs\SiteReviews\Helpers\Arr; class SiteReviewsFormDefaults extends DefaultsAbstract { /** * The values that should be cast before sanitization is run. * This is done before $sanitize and $enums. * @var array */ public $casts = [ 'debug' => 'bool', ]; /** * The values that should be guarded. * @var string[] */ public $guarded = [ 'description', 'title', ]; /** * The keys that should be mapped to other keys. * Keys are mapped before the values are normalized and sanitized. * Note: Mapped keys should not be included in the defaults! * @var array */ public $mapped = [ 'assign_to' => 'assigned_posts', 'category' => 'assigned_terms', 'user' => 'assigned_users', ]; /** * The values that should be sanitized. * This is done after $casts and before $enums. * @var array */ public $sanitize = [ 'class' => 'attr-class', 'description' => 'text', 'hide' => 'array-string', 'id' => 'id-hash', 'reviews_id' => 'id', 'title' => 'text', ]; /** * @return array */ protected function defaults() { return [ 'assigned_posts' => '', 'assigned_terms' => '', 'assigned_users' => '', 'class' => '', 'debug' => false, 'description' => '', 'form_id' => '', 'hide' => '', 'id' => '', 'reviews_id' => '', 'title' => '', ]; } /** * Finalize provided values, this always runs last. * @return array */ protected function finalize(array $values = []) { $values['form_id'] = $values['id']; // used for the validation session key and to generate the honeypot hash return $values; } /** * Normalize provided values, this always runs first. * @return array */ protected function normalize(array $values = []) { foreach ($this->mapped as $old => $new) { if ('custom' === Arr::get($values, $old)) { $values[$old] = Arr::get($values, $new); } } return parent::normalize($values); } }
Copyright ©2021 || Defacer Indonesia