Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/import/PhabricatorCalendarImportEngine.php
Context not available. | |||||
foreach ($node_map as $full_uid => $node) { | foreach ($node_map as $full_uid => $node) { | ||||
$uid = $node->getUID(); | $uid = $node->getUID(); | ||||
$matches = null; | $matches = null; | ||||
if (preg_match('/^(PHID-.*)@(.*)\z/', $uid, $matches)) { | if (@preg_match('/^(PHID-.*)@(.*)\z/', $uid, $matches)) { | ||||
$likely_phids[$full_uid] = $matches[1]; | $likely_phids[$full_uid] = $matches[1]; | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
// We avoid disclosing email addresses to be consistent with the rest | // We avoid disclosing email addresses to be consistent with the rest | ||||
// of the product. | // of the product. | ||||
$name = $attendee->getName(); | $name = $attendee->getName(); | ||||
if (preg_match('/@/', $name)) { | if (@preg_match('/@/', $name)) { | ||||
$name = new PhutilEmailAddress($name); | $name = new PhutilEmailAddress($name); | ||||
$name = $name->getDisplayName(); | $name = $name->getDisplayName(); | ||||
} | } | ||||
// If we don't have a name or the name still looks like it's an | // If we don't have a name or the name still looks like it's an | ||||
// email address, give them a dummy placeholder name. | // email address, give them a dummy placeholder name. | ||||
if (!strlen($name) || preg_match('/@/', $name)) { | if (!@strlen($name) || @preg_match('/@/', $name)) { | ||||
$name = pht('Private User %d', $private_index); | $name = pht('Private User %d', $private_index); | ||||
$private_index++; | $private_index++; | ||||
} | } | ||||
Context not available. | |||||
private function getParentNodeUID(PhutilCalendarEventNode $node) { | private function getParentNodeUID(PhutilCalendarEventNode $node) { | ||||
$recurrence_id = $node->getRecurrenceID(); | $recurrence_id = $node->getRecurrenceID(); | ||||
if (!strlen($recurrence_id)) { | if (!@strlen($recurrence_id)) { | ||||
return null; | return null; | ||||
} | } | ||||
Context not available. | |||||
private function getNodeInstanceEpoch(PhutilCalendarEventNode $node) { | private function getNodeInstanceEpoch(PhutilCalendarEventNode $node) { | ||||
$instance_iso = $node->getRecurrenceID(); | $instance_iso = $node->getRecurrenceID(); | ||||
if (strlen($instance_iso)) { | if (@strlen($instance_iso)) { | ||||
$instance_datetime = PhutilCalendarAbsoluteDateTime::newFromISO8601( | $instance_datetime = PhutilCalendarAbsoluteDateTime::newFromISO8601( | ||||
$instance_iso); | $instance_iso); | ||||
$instance_epoch = $instance_datetime->getEpoch(); | $instance_epoch = $instance_datetime->getEpoch(); | ||||
Context not available. | |||||
} | } | ||||
$name = $node->getName(); | $name = $node->getName(); | ||||
if (!strlen($name)) { | if (!@strlen($name)) { | ||||
if (strlen($uid)) { | if (@strlen($uid)) { | ||||
$name = pht('Unnamed Event "%s"', $uid); | $name = pht('Unnamed Event "%s"', $uid); | ||||
} else { | } else { | ||||
$name = pht('Unnamed Imported Event'); | $name = pht('Unnamed Imported Event'); | ||||
Context not available. | |||||
} | } | ||||
final protected function shouldQueueDataImport($data) { | final protected function shouldQueueDataImport($data) { | ||||
return (strlen($data) > self::QUEUE_BYTE_LIMIT); | return (@strlen($data) > self::QUEUE_BYTE_LIMIT); | ||||
} | } | ||||
final protected function queueDataImport( | final protected function queueDataImport( | ||||
Context not available. | |||||
$import->newLogMessage( | $import->newLogMessage( | ||||
PhabricatorCalendarImportQueueLogType::LOGTYPE, | PhabricatorCalendarImportQueueLogType::LOGTYPE, | ||||
array( | array( | ||||
'data.size' => strlen($data), | 'data.size' => @strlen($data), | ||||
'data.limit' => self::QUEUE_BYTE_LIMIT, | 'data.limit' => self::QUEUE_BYTE_LIMIT, | ||||
)); | )); | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0