- Better error handling in Twitter posting.
- Show oEmbed data for XHTML files as well as plain HTML.
- Updated bug database link in README.
-- require HTML tidy extension.
- add support for HTTP Basic Auth in PHP CGI or FastCGI (e.g. GoDaddy).
- autofocus input to selected entry elements depending on page.
- updated layout for filter-by-tag form.
- GD. For scaling down avatar images.
- mbstring. For handling Unicode (UTF-8) encoded strings.
- gettext. For multiple languages. Default on many PHP installs.
-- tidy. Used to clean up HTML/URLs for the URL shortener to consume.
For some functionality, you will also need the following extensions:
}
$reqs = array('gd', 'curl',
- 'xmlwriter', 'mbstring','tidy');
+ 'xmlwriter', 'mbstring', 'xml', 'dom', 'simplexml');
foreach ($reqs as $req) {
if (!checkExtension($req)) {
if (!isset($y->body)) return;
$x = $y->body->p[0]->a->attributes();
if (isset($x['href'])) {
- return $x['href'];
+ return strval($x['href']);
}
}
}
{
$response = $this->http_get(sprintf($this->serviceUrl,urlencode($url)));
if (!$response) return;
- $response = $this->tidy($response);
- $y = @simplexml_load_string($response);
+ $dom = new DOMDocument();
+ @$dom->loadHTML($response);
+ $y = @simplexml_import_dom($dom);
if (!isset($y->body)) return;
$xml = $y->body->center->table->tr->td->pre->a->attributes();
- if (isset($xml['href'])) return $xml['href'];
+ if (isset($xml['href'])) {
+ return strval($xml['href']);
+ }
}
}
{
$response = $this->http_get(sprintf($this->serviceUrl,urlencode($url)));
if (!$response) return;
- $response = $this->tidy($response);
- $y = @simplexml_load_string($response);
+ $dom = new DOMDocument();
+ @$dom->loadHTML($response);
+ $y = @simplexml_import_dom($dom);
if (!isset($y->body)) return;
$xml = $y->body->p[0]->code[0]->a->attributes();
- if (isset($xml['href'])) return $xml['href'];
+ if (isset($xml['href'])) {
+ return strval($xml['href']);
+ }
}
}
return $response->getBody();
}
- protected function tidy($response) {
- $response = str_replace(' ', ' ', $response);
- $config = array('output-xhtml' => true);
- $tidy = new tidy;
- $tidy->parseString($response, $config, 'utf8');
- $tidy->cleanRepair();
- return (string)$tidy;
- }
//------------Below are the methods that connect StatusNet to the implementing Url Shortener plugin------------\\
function onInitializePlugin(){