Example #1
0
 function normalize($value, $hint)
 {
     // strip off leading [[ and trailing ]] to offer a more
     // user-friendly syntax.
     if (substr($value, 0, 2) == '[[' && substr($value, -2) == ']]') {
         $value = substr($value, 2, -2);
     }
     if (!preg_match('/^[a-zA-Z0-9\\.]+>{1}.*$/u', $value) && !preg_match('/^\\\\\\\\[^\\\\]+?\\\\/u', $value) && !preg_match('#^([a-z0-9\\-\\.+]+?)://#i', $value) && !preg_match('<' . PREG_PATTERN_VALID_EMAIL . '>', $value)) {
         $page = new plugin_strata_type_page();
         return $page->normalize($value, null);
     }
     return $value;
 }
Example #2
0
 function __construct()
 {
     $this->util =& plugin_load('helper', 'strata_util');
     parent::__construct();
 }