@@ -97,6 +97,8 @@ class Core
97
97
# mode.
98
98
DefangedProhibitedDataStoreElements = [ "MsfModulePaths" ]
99
99
100
+ # Constant for disclosure date formatting in search functions
101
+ DISCLOSURE_DATE_FORMAT = "%Y-%m-%d"
100
102
# Returns the list of commands supported by this command dispatcher
101
103
def commands
102
104
{
@@ -1477,7 +1479,7 @@ def cmd_search(*args)
1477
1479
next if not o
1478
1480
1479
1481
if not o . search_filter ( match )
1480
- tbl << [ o . fullname , o . disclosure_date . to_s , o . rank_to_s , o . name ]
1482
+ tbl << [ o . fullname , o . disclosure_date . nil? ? "" : o . disclosure_date . strftime ( DISCLOSURE_DATE_FORMAT ) , o . rank_to_s , o . name ]
1481
1483
end
1482
1484
end
1483
1485
end
@@ -1492,7 +1494,7 @@ def cmd_search(*args)
1492
1494
def search_modules_sql ( search_string )
1493
1495
tbl = generate_module_table ( "Matching Modules" )
1494
1496
framework . db . search_modules ( search_string ) . each do |o |
1495
- tbl << [ o . fullname , o . disclosure_date . to_s , RankingName [ o . rank ] . to_s , o . name ]
1497
+ tbl << [ o . fullname , o . disclosure_date . nil? ? "" : o . disclosure_date . strftime ( DISCLOSURE_DATE_FORMAT ) , RankingName [ o . rank ] . to_s , o . name ]
1496
1498
end
1497
1499
print_line ( tbl . to_s )
1498
1500
end
@@ -3270,7 +3272,7 @@ def show_module_set(type, module_set, regex = nil, minrank = nil, opts = nil) #
3270
3272
end
3271
3273
end
3272
3274
if ( opts == nil or show == true )
3273
- tbl << [ refname , o . disclosure_date || "" , o . rank_to_s , o . name ]
3275
+ tbl << [ refname , o . disclosure_date . nil? ? "" : o . disclosure_date . strftime ( DISCLOSURE_DATE_FORMAT ) , o . rank_to_s , o . name ]
3274
3276
end
3275
3277
end
3276
3278
end
0 commit comments