Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -43,6 +43,7 @@ class _Text extends TextArea
|
||||
'prefix' => TRUE, // If TRUE, user will have option to specify one tag as a prefix
|
||||
'resultItemTemplate'=> 'core.foo.bar', // Can be used to specify a custom JavaScript template to use for the result
|
||||
'minAjaxLength' => 3, // Minimum length of value before sending AJAX lookup call
|
||||
'disallowedCharacters' => array() // An array of disallowed characters (default < > ' ")
|
||||
),
|
||||
'placeholder' => 'e.g. ...', // A placeholder (NB: Will only work on compatible browsers)
|
||||
'regex' => '/[A-Z]+/i', // RegEx of acceptable value
|
||||
@@ -89,7 +90,7 @@ class _Text extends TextArea
|
||||
|
||||
/* Set username regex */
|
||||
$args = func_get_args();
|
||||
if ( isset( $args[3]['accountUsername'] ) and $args[3]['accountUsername'] === TRUE )
|
||||
if ( isset( $args[3]['accountUsername'] ) and $args[3]['accountUsername'] !== FALSE )
|
||||
{
|
||||
$args[3]['maxLength'] = \IPS\Settings::i()->max_user_name_length;
|
||||
|
||||
@@ -122,6 +123,16 @@ class _Text extends TextArea
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
/* 10/19/15 - adding htmlspecialchars around value if autocomplete is enabled so that html tag characters can be used (e.g. for members) */
|
||||
/* This value is decoded by the JS widget before use. See https://community.invisionpower.com/4bugtrack/active-reports/cannot-pm-certain-members-r6181/ */
|
||||
if( $this->options['autocomplete'] and !empty( $this->value ) )
|
||||
{
|
||||
foreach( $this->value as $key => $value )
|
||||
{
|
||||
$this->value[ $key ] = htmlspecialchars( $value, ENT_QUOTES | \IPS\HTMLENTITIES, 'UTF-8', FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'core', 'global' )->text( $this->name, $this->formType, $this->value, $this->required, $this->options['maxLength'], $this->options['size'], $this->options['disabled'], $this->options['autocomplete'], $this->options['placeholder'], NULL, $this->options['nullLang'], $this->htmlId );
|
||||
}
|
||||
|
||||
@@ -154,6 +165,11 @@ class _Text extends TextArea
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $this->options['autocomplete'] ) )
|
||||
{
|
||||
$return = htmlspecialchars_decode( $return, ENT_QUOTES );
|
||||
}
|
||||
|
||||
/* Remove all invisible characters */
|
||||
$return = preg_replace( '/\p{C}+/u', '', $return );
|
||||
|
||||
|
||||
Reference in new issue
Block a user