}
break;
default:
- // Transforms quoted tweets in rich attachments to avoid nested tweetsx
- if (stripos(normalise_link($link), 'http://twitter.com/') === 0) {
+ // Transforms quoted tweets in rich attachments to avoid nested tweets
+ if (stripos(normalise_link($link), 'http://twitter.com/') === 0 && OEmbed::isAllowedURL($link)) {
$bookmark = array(sprintf('[bookmark=%s]%s[/bookmark]', $link, $preshare), $link, $preshare);
$text = $preshare . tryoembed($bookmark);
} else {
}\r
}\r
\r
+ /**\r
+ * Determines if rich content OEmbed is allowed for the provided URL\r
+ *\r
+ * @brief Determines if rich content OEmbed is allowed for the provided URL\r
+ * @param string $url\r
+ * @return boolean\r
+ */\r
+ public static function isAllowedURL($url)\r
+ {\r
+ if (!Config::get('system', 'no_oembed_rich_content')) {\r
+ return true;\r
+ }\r
+\r
+ $domain = parse_url($url, PHP_URL_HOST);\r
+\r
+ $str_allowed = Config::get('system', 'allowed_oembed', '');\r
+ $allowed = explode(',', $str_allowed);\r
+\r
+ return allowed_domain($domain, $allowed, true);\r
+ }\r
+\r
/**\r
* @brief Generates the iframe HTML for an oembed attachment.\r
*\r
return $innerHTML;\r
}\r
\r
- /**\r
- * Determines if rich content OEmbed is allowed for the provided URL\r
- *\r
- * @brief Determines if rich content OEmbed is allowed for the provided URL\r
- * @param string $url\r
- * @return boolean\r
- */\r
- private static function isAllowedURL($url)\r
- {\r
- if (!Config::get('system', 'no_oembed_rich_content')) {\r
- return true;\r
- }\r
-\r
- $domain = parse_url($url, PHP_URL_HOST);\r
-\r
- $str_allowed = Config::get('system', 'allowed_oembed', '');\r
- $allowed = explode(',', $str_allowed);\r
-\r
- return allowed_domain($domain, $allowed, true);\r
- }\r
}\r