Merge remote branch 'laconica/0.8.x' into 0.9.x

Conflicts:
	lib/common.php
	lib/twitter.php
This commit is contained in:
Craig Andrews
2009-09-02 16:42:15 -04:00
25 changed files with 736 additions and 179 deletions

View File

@@ -256,7 +256,7 @@ class Services_oEmbed
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (substr($code, 0, 1) != '2') {
throw new Services_oEmbed_Exception('Non-200 code returned');
throw new Services_oEmbed_Exception('Non-200 code returned. Got code ' . $code);
}
curl_close($ch);
@@ -302,8 +302,8 @@ class Services_oEmbed
// Find all <link /> tags that have a valid oembed type set. We then
// extract the href attribute for each type.
$regexp = '#<link([^>]*)type="' .
'(application/json|text/xml)\+oembed"([^>]*)>#i';
$regexp = '#<link([^>]*)type[\s\n]*=[\s\n]*"' .
'(application/json|text/xml)\+oembed"([^>]*)>#im';
$m = $ret = array();
if (!preg_match_all($regexp, $body, $m)) {
@@ -314,7 +314,7 @@ class Services_oEmbed
foreach ($m[0] as $i => $link) {
$h = array();
if (preg_match('/href="([^"]+)"/i', $link, $h)) {
if (preg_match('/[\s\n]+href[\s\n]*=[\s\n]*"([^"]+)"/im', $link, $h)) {
$ret[$m[2][$i]] = $h[1];
}
}
@@ -347,7 +347,7 @@ class Services_oEmbed
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (substr($code, 0, 1) != '2') {
throw new Services_oEmbed_Exception('Non-200 code returned');
throw new Services_oEmbed_Exception('Non-200 code returned. Got code ' . $code);
}
return $result;

View File

@@ -454,7 +454,7 @@ class Stomp
*/
public function disconnect ()
{
$header = array();
$headers = array();
if ($this->clientId != null) {
$headers["client-id"] = $this->clientId;