summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-08-24 13:36:12 +0200
committerAleksander Machniak <alec@alec.pl>2012-08-24 13:36:12 +0200
commite8be303af3b3cb5187101e9d6f160e0aa8f07285 (patch)
treef2af1bac816e8b05779999a457401daa6ecb1917
parente077c189bbb2c92f75d849a17dd88d025e392e69 (diff)
Added tests for shared functions, fixed small issues
-rw-r--r--program/include/rcube_shared.inc8
-rw-r--r--tests/phpunit.xml1
2 files changed, 5 insertions, 4 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 5b839d8d2..276940cb6 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -108,11 +108,11 @@ function slashify($str)
/**
- * Remove slash at the end of the string
+ * Remove slashes at the end of the string
*/
function unslashify($str)
{
- return preg_replace('/\/$/', '', $str);
+ return preg_replace('/\/+$/', '', $str);
}
@@ -231,7 +231,7 @@ function array_keys_recursive($array)
{
$keys = array();
- if (!empty($array)) {
+ if (!empty($array) && is_array($array)) {
foreach ($array as $key => $child) {
$keys[] = $key;
foreach (array_keys_recursive($child) as $val) {
@@ -255,7 +255,7 @@ function asciiwords($str, $css_id = false, $replace_with = '')
/**
- * Remove single and double quotes from given string
+ * Remove single and double quotes from a given string
*
* @param string Input value
*
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index cfd066e29..d6212f458 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -7,6 +7,7 @@
<file>MailDecode.php</file>
<file>MailFunc.php</file>
<file>ModCss.php</file>
+ <file>Shared.php</file>
<file>Utils.php</file>
<file>VCards.php</file>
</testsuite>