Skip to content

Commit df426cd

Browse files
committed
add nullable url form field
1 parent f906153 commit df426cd

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace wcf\system\form\builder\field;
4+
5+
class MCNullableUrlFormField extends UrlFormField implements INullableFormField {
6+
use TNullableFormField;
7+
8+
/**
9+
* @inheritDoc
10+
*/
11+
public function getSaveValue() {
12+
if ($this->getValue() === null && !$this->isNullable()) {
13+
return '';
14+
}
15+
16+
return parent::getSaveValue();
17+
}
18+
}

0 commit comments

Comments
 (0)