summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg.pm
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-01-09 20:19:26 -0500
committerChristopher Burger <burgerc@freeside.biz>2019-01-10 09:34:44 -0500
commitd5d62e40593d5153afd64527accad35b7f4fda2e (patch)
treebfd8d43bdda6d861b169b3a153ea75b3e0790c66 /FS/FS/part_pkg.pm
parentae6359efac06d899093f799052ef8d472effbe98 (diff)
RT# 81249 - Fixed error where empty field becomes 0.
Diffstat (limited to 'FS/FS/part_pkg.pm')
-rw-r--r--FS/FS/part_pkg.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 1895404..4aa2926 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -695,12 +695,23 @@ sub replace {
sub validate_number {
my ($option, $valref) = @_;
+
$$valref = 0 unless $$valref;
return "Invalid $option"
unless ($$valref) = ($$valref =~ /^\s*(\d+)\s*$/);
return '';
}
+sub validate_number_blank {
+ my ($option, $valref) = @_;
+
+ if ($$valref) {
+ return "Invalid $option"
+ unless ($$valref) = ($$valref =~ /^\s*(\d+)\s*$/);
+ }
+ return '';
+}
+
=item check
Checks all fields to make sure this is a valid package definition. If