Changeset 224 for trunk/lib/Utilities.inc.php
- Timestamp:
- Jan 9, 2007 12:47:08 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r219 r224 524 524 * @return string Comma list of array values. 525 525 */ 526 function escapedList($in )526 function escapedList($in, $separator="', '") 527 527 { 528 528 $db =& DB::getInstance(); 529 529 530 530 if (is_array($in) && !empty($in)) { 531 return "'" . join("', '", array_map(array($db, 'escapeString'), $in)) . "'";531 return join($separator, array_map(array($db, 'escapeString'), $in)); 532 532 } else { 533 533 return $db->escapeString($in); … … 549 549 // Translate the human string date into SQL-safe date format. 550 550 if (empty($date) || strpos($date, '0000-00-00') !== false || strtotime($date) === -1 || strtotime($date) === false) { 551 return '0000-00-00'; 551 // Return a string of zero time, formatted the same as $format. 552 return strtr($format, array( 553 'Y' => '0000', 554 'm' => '00', 555 'd' => '00', 556 'H' => '00', 557 'i' => '00', 558 's' => '00', 559 )); 552 560 } else { 553 561 return date($format, strtotime($date));
Note: See TracChangeset
for help on using the changeset viewer.