Description
Return true if we think we should process the word, false otherwiseNote: We expect the words to be split on blank characters Strings we should not auto translate contain:
| Value | Example usage |
|---|---|
| :// | URLs http://, https://, ftp://, ftps://, mailto:// |
| @ | email addresses |
| % | symbolic substitution variables e.g. %1$s |
| = | keyword=”value” … but this could have problems if within HTML tags… |
| & | symbolic html such as &lasquo; so we cater for < and > separately |
Usage
$bool = bboing_process_word( $word );Parameters
- $word
- ( string ) required –
Returns
bool true if we should process the wordSource
File name: bbboing/bbboing.incLines:
1 to 19 of 19
function bboing_process_word( $word ) { $process = true; $ignores = array( "://", "@", "%", "=", "&", "[", "]" ); foreach ( $ignores as $ignore ) { if ( strpos( $word, $ignore ) !== false ) { $process = false; break; } } $reportable = array( "<", ">" ); foreach ( $reportable as $report ) { if ( strpos( $word, $report ) !== false ) { $process = false; // echo "#. Possible embedded HTML in string. Consider changing code\n" ; break; } } return( $process ); }View on GitHub View on Trac
Invoked by
Calls
Call hooks
API Letters:
