| @@ 726-740 (lines=15) @@ | ||
| 723 | case XOBJ_DTYPE_DATE: |
|
| 724 | $cleanv = !is_string($cleanv) && is_numeric($cleanv) ? date(_DBDATESTRING, $cleanv) : date(_DBDATESTRING, strtotime($cleanv)); |
|
| 725 | break; |
|
| 726 | case XOBJ_DTYPE_TXTBOX: |
|
| 727 | if ($v['required'] && $cleanv != '0' && $cleanv == '') { |
|
| 728 | $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); |
|
| 729 | continue 2; |
|
| 730 | } |
|
| 731 | if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) { |
|
| 732 | $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength'])); |
|
| 733 | continue 2; |
|
| 734 | } |
|
| 735 | if (!$v['not_gpc']) { |
|
| 736 | $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv)); |
|
| 737 | } else { |
|
| 738 | $cleanv = $ts->censorString($cleanv); |
|
| 739 | } |
|
| 740 | break; |
|
| 741 | case XOBJ_DTYPE_TXTAREA: |
|
| 742 | if ($v['required'] && $cleanv != '0' && $cleanv == '') { |
|
| 743 | $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); |
|
| @@ 807-822 (lines=16) @@ | ||
| 804 | continue 2; |
|
| 805 | } |
|
| 806 | break; |
|
| 807 | case XOBJ_DTYPE_UNICODE_TXTBOX: |
|
| 808 | if ($v['required'] && $cleanv != '0' && $cleanv == '') { |
|
| 809 | $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); |
|
| 810 | continue 2; |
|
| 811 | } |
|
| 812 | $cleanv = xoops_convert_encode($cleanv); |
|
| 813 | if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) { |
|
| 814 | $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength'])); |
|
| 815 | continue 2; |
|
| 816 | } |
|
| 817 | if (!$v['not_gpc']) { |
|
| 818 | $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv)); |
|
| 819 | } else { |
|
| 820 | $cleanv = $ts->censorString($cleanv); |
|
| 821 | } |
|
| 822 | break; |
|
| 823 | case XOBJ_DTYPE_UNICODE_TXTAREA: |
|
| 824 | if ($v['required'] && $cleanv != '0' && $cleanv == '') { |
|
| 825 | $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k)); |
|