|
@@ 73-80 (lines=8) @@
|
| 70 |
|
*/ |
| 71 |
|
private static function checkIcon(SlackMessage $message) |
| 72 |
|
{ |
| 73 |
|
if (!empty($message->getIconUrl())) { |
| 74 |
|
if (!preg_match( |
| 75 |
|
'/^(?:http|https|ftp)\:\/\/(.*?)\.(.*?)\/(.*?)\.(?:jpg|jpeg|png)/i', |
| 76 |
|
$message->getIconUrl() |
| 77 |
|
)) { |
| 78 |
|
throw new SlackbotException(SlackbotException::E_INCORRECT_ICON_URL); |
| 79 |
|
} |
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
if (!empty($message->getIconEmoji())) { |
| 83 |
|
if (!preg_match('/^\:[a-zA-Z\-\_\d]+\:$/i', $message->getIconEmoji())) { |
|
@@ 82-86 (lines=5) @@
|
| 79 |
|
} |
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
if (!empty($message->getIconEmoji())) { |
| 83 |
|
if (!preg_match('/^\:[a-zA-Z\-\_\d]+\:$/i', $message->getIconEmoji())) { |
| 84 |
|
throw new SlackbotException(SlackbotException::E_INCORRECT_ICON_EMOJI); |
| 85 |
|
} |
| 86 |
|
} |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
private static function checkAttachments(SlackMessage $message) |