From 33c00ae4beb67eb0becd759ac20eb8e946007781 Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Fri, 23 Sep 2016 10:02:50 +0200 Subject: [PATCH] Updated Vendors [+]: update "portable-utf8" from 2.x -> 3.x [+]: update "anti-xss" from 1.x -> 2.x --- .travis.yml | 1 + composer.json | 4 ++-- src/Methods/Misc.php | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5178a84..19216d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: php php: - "hhvm" + - "7.1" - "7.0" - "5.6" - "5.5" diff --git a/composer.json b/composer.json index e187933..edc0610 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^5.4 || ^7.0", - "voku/portable-utf8": "^2.0", + "voku/portable-utf8": "^3.0", "icecave/parity": "^1.0" }, "require-dev": @@ -22,7 +22,7 @@ "couscous/couscous": "^1.5", "codegyre/robo": "^0.7", "phpunit/phpunit": "^4.8", - "voku/anti-xss": "^1.2", + "voku/anti-xss": "^2.0", "voku/urlify": "^2.0", "icanboogie/inflector": "^1.4", "satooshi/php-coveralls": "^1.0" diff --git a/src/Methods/Misc.php b/src/Methods/Misc.php index 2e489f2..43919d8 100644 --- a/src/Methods/Misc.php +++ b/src/Methods/Misc.php @@ -113,7 +113,7 @@ public function repeat($multiplier) /** * Returns a reversed string. A multibyte version of strrev(). * - * @return Stringy Object with a reversed $str + * @return static Object with a reversed $str */ public function reverse() { @@ -211,6 +211,11 @@ public function tidy() */ public function countSubstr($substring, $caseSensitive = true) { + if (!isset($this->scalarString[0])) + { + return 0; + } + if ($caseSensitive) { return UTF8::substr_count