示例#1
0
 function grab()
 {
     $value = $this->grab_value();
     if (!$this->userland_changeable && $value !== NULL && $value != $this->get() && preg_replace('/\\s+/', '', $value) != preg_replace('/\\s+/', '', $this->get())) {
         trigger_error('hidden element (' . $this->name . ') value changed in userland (' . $value . ' != ' . $this->get() . '). If you wish to permit userland changes to this field, set the userland_changeable param.');
     }
     parent::grab();
 }
示例#2
0
 function grab()
 {
     parent::grab();
     $length = strlen($this->value);
     $length_limits = array('tinytext' => 255, 'text' => 65535, 'mediumtext' => 16777215);
     if (!empty($this->db_type) && array_key_exists($this->db_type, $length_limits)) {
         if ($length > $length_limits[$this->db_type]) {
             $name_to_display = trim($this->display_name);
             if (empty($name_to_display)) {
                 $name_to_display = prettify_string($this->name);
             }
             $this->set_error('There is more text in ' . $name_to_display . ' than can be stored; this field can hold no more than ' . $length_limits[$this->db_type] . ' characters.');
         }
     }
 }