-
-
Save tommcfarlin/8edbf9a45d168d7d71a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A santization function that will take the incoming input, and make | |
* sure that it's secure before saving it to the database. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $input The name input. | |
* @return array $new_input The sanitized input. | |
*/ | |
public function sanitize( $input ) { | |
// Prepare the new array to save | |
$new_input = array(); | |
// Set the name to save to the database | |
$new_input['name'] = | |
( $this->validator->is_valid_name( $input['name'] ) ) ? | |
$this->validator->sanitize_input( $input['name'] ) : | |
''; | |
return $new_input; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A santization function that will take the incoming input, and make | |
* sure that it's secure before saving it to the database. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $input The name input. | |
* @return array $new_input The sanitized input. | |
*/ | |
public function sanitize( $input ) { | |
// Prepare the new array to save | |
$new_input = array(); | |
// Set the name to save to the database | |
$new_input['name'] = | |
( $this->validator->is_valid_name( $input['name'] ) ) ? | |
$this->validator->sanitize_input( $input['name'] ) : | |
''; | |
// Return false if the 'name' index isn't set | |
return ( empty( $new_input['name'] ) ) ? false : $new_input; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment