summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-10-18 12:49:20 -0700
committerBrion Vibber <brion@pobox.com>2010-10-18 12:49:20 -0700
commit140308bb03ecf99ac5738d6adbef066bf4e60461 (patch)
treef9c747a39523b62295cc3cb2aadda37d8f0b0819 /plugins
parent7765ddae81e9b29af06009d961b3d56b293f527c (diff)
parentaa80d8fee3865e25e8d47a5c83b6575ca3dc79ea (diff)
Merge branch '0.9.x' into 1.0.x
Diffstat (limited to 'plugins')
-rw-r--r--plugins/DirectionDetector/DirectionDetectorPlugin.php3
-rw-r--r--plugins/OStatus/tests/FeedDiscoveryTest.php9
2 files changed, 9 insertions, 3 deletions
diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php
index 1473c386f..4a38f390f 100644
--- a/plugins/DirectionDetector/DirectionDetectorPlugin.php
+++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php
@@ -81,6 +81,9 @@ class DirectionDetectorPlugin extends Plugin {
* @return boolean
*/
public static function startsWithRTLCharacter($str){
+ if (strlen($str) < 1) {
+ return false;
+ }
if( is_array($cc = self::utf8ToUnicode(mb_substr($str, 0, 1, 'utf-8'))) )
$cc = $cc[0];
else
diff --git a/plugins/OStatus/tests/FeedDiscoveryTest.php b/plugins/OStatus/tests/FeedDiscoveryTest.php
index 3be4bf736..ef17efe7c 100644
--- a/plugins/OStatus/tests/FeedDiscoveryTest.php
+++ b/plugins/OStatus/tests/FeedDiscoveryTest.php
@@ -75,9 +75,10 @@ END;
'<body><pre><LINK rel=alternate hRef=http://example.com/feed/rss type=application/rss+xml><fnork',
'http://example.com/feed/rss'),
// 'rel' attribute must be lowercase, alone per http://www.rssboard.org/rss-autodiscovery
+ // but we're going to be liberal in what we receive.
array('http://example.com/tagsoup2',
'<body><pre><LINK rel=" feeders alternate 467" hRef=http://example.com/feed/rss type=application/rss+xml><fnork',
- false),
+ 'http://example.com/feed/rss'),
array('http://example.com/tagsoup3',
'<body><pre><LINK rel=ALTERNATE hRef=http://example.com/feed/rss type=application/rss+xml><fnork',
false),
@@ -87,18 +88,20 @@ END;
array('http://example.com/relative/link2',
'<html><link rel="alternate" href="../feed/rss" type="application/rss+xml">',
'http://example.com/feed/rss'),
+ // This one can't resolve correctly; relative link is bogus.
array('http://example.com/relative/link3',
'<html><link rel="alternate" href="http:/feed/rss" type="application/rss+xml">',
- 'http://example.com/feed/rss'),
+ 'http:/feed/rss'),
array('http://example.com/base/link1',
'<html><link rel="alternate" href="/feed/rss" type="application/rss+xml"><base href="http://target.example.com/">',
'http://target.example.com/feed/rss'),
array('http://example.com/base/link2',
'<html><link rel="alternate" href="feed/rss" type="application/rss+xml"><base href="http://target.example.com/">',
'http://target.example.com/feed/rss'),
+ // This one can't resolve; relative link is bogus.
array('http://example.com/base/link3',
'<html><link rel="alternate" href="http:/feed/rss" type="application/rss+xml"><base href="http://target.example.com/">',
- 'http://target.example.com/feed/rss'),
+ 'http:/feed/rss'),
// Trick question! There's a <base> but no href on it
array('http://example.com/relative/fauxbase',
'<html><link rel="alternate" href="../feed/rss" type="application/rss+xml"><base target="top">',