You appear to be a bot. Output may be restricted
Description
Return a validated name field
At the start of coding this all we wanted to do was to not accept a name starting with a digit e.g. 532ff6123 Because, except for names in non Latin languages it should really be a letter. So I looked at stack overflow and found this, which seems like as good a start as any http://stackoverflow.com/questions/888838/regular-expression-for-validating-names-and-surnames Trying this Regular expression ^[\p{L} \.'\-]+$ But in the 'complete tested solution' it's ^[\p{L}\p{M}' \.\-]+$ And perhaps we need to convert apostrophes to '
Usage
$string|null = oiksp_validate_name();
Parameters
Returns
string|null the name field if validated
Source
File name: oik-squeeze/shortcodes/oik-squeeze.php
Lines:
function oiksp_validate_name() { $name = bw_array_get( $_REQUEST, "oiksp_name", null ); $name = trim( $name ); $matched = preg_match("/^[\p{L} \.'\-]+$/", $name, $output_array); //bw_trace2( $output_array, "output array" ); //bw_trace2( $matched, "matched", false ); if ( !$matched ) { $name = null; } return( $name ); }