Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2684146
D25389.1734697511.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25389.1734697511.diff
View Options
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php
@@ -24,7 +24,7 @@
public function getValueForStorage() {
$value = $this->getFieldValue();
- if (strlen($value)) {
+ if (phutil_nonempty_scalar($value)) {
return (int)$value;
} else {
return null;
@@ -32,7 +32,7 @@
}
public function setValueFromStorage($value) {
- if (strlen($value)) {
+ if (phutil_nonempty_scalar($value)) {
$value = (int)$value;
} else {
$value = null;
@@ -74,7 +74,8 @@
// specify as a string. Parse the string into an epoch.
$value = $this->getFieldValue();
- if (!ctype_digit($value)) {
+ if ($value !== null && gettype($value) !== 'integer' &&
+ !ctype_digit($value)) {
$value = PhabricatorTime::parseLocalTime($value, $this->getViewer());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 12:25 (10 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1017547
Default Alt Text
D25389.1734697511.diff (1 KB)
Attached To
Mode
D25389: Fix PHP 8.1 "strlen(null)" exceptions editing a form when custom field of type Date exists
Attached
Detach File
Event Timeline
Log In to Comment