From d67a9b437c3545b3a435953dbb529b64934cc767 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 18 Oct 2010 12:23:01 -0700 Subject: Avoid notice in DirectionDetectorPlugin when dealing with empty string. --- plugins/DirectionDetector/DirectionDetectorPlugin.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') 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 -- cgit v1.2.3-54-g00ecf From aa80d8fee3865e25e8d47a5c83b6575ca3dc79ea Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 18 Oct 2010 12:45:55 -0700 Subject: Clean up edge cases in OStatus FeedDiscoveryTest --- plugins/OStatus/tests/FeedDiscoveryTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'plugins') 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; '
',
                            'http://example.com/feed/rss'),
+                     // This one can't resolve correctly; relative link is bogus.
                      array('http://example.com/relative/link3',
                            '',
-                           'http://example.com/feed/rss'),
+                           'http:/feed/rss'),
                      array('http://example.com/base/link1',
                            '',
                            'http://target.example.com/feed/rss'),
                      array('http://example.com/base/link2',
                            '',
                            'http://target.example.com/feed/rss'),
+                     // This one can't resolve; relative link is bogus.
                      array('http://example.com/base/link3',
                            '',
-                           'http://target.example.com/feed/rss'),
+                           'http:/feed/rss'),
                      // Trick question! There's a  but no href on it
                      array('http://example.com/relative/fauxbase',
                            '',
-- 
cgit v1.2.3-54-g00ecf