Using a foreach loop avoids Notice warnings when the array doesn't have sequential indexes, ex: 0, 1, 3...
This commit is contained in:
parent
c4ba9ef2d2
commit
72269aa1d6
@ -98,7 +98,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
|
|||||||
|
|
||||||
$tags_count = is_array($tags)?count($tags):0;
|
$tags_count = is_array($tags)?count($tags):0;
|
||||||
|
|
||||||
for ($i = 0; $i < $tags_count; $i++) {
|
foreach($tags as $i => $tag) {
|
||||||
$tags[$i] = trim(utf8_strtolower($tags[$i]));
|
$tags[$i] = trim(utf8_strtolower($tags[$i]));
|
||||||
if ($fromApi) {
|
if ($fromApi) {
|
||||||
include_once 'SemanticScuttle/functions.php';
|
include_once 'SemanticScuttle/functions.php';
|
||||||
|
@ -144,7 +144,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService
|
|||||||
$tags = utf8_strtolower(trim($tags));
|
$tags = utf8_strtolower(trim($tags));
|
||||||
} else {
|
} else {
|
||||||
$tags = array_filter($tags);//remove empty values
|
$tags = array_filter($tags);//remove empty values
|
||||||
for($i=0; $i<count($tags); $i++) {
|
foreach($tags as $i => $tag) {
|
||||||
$tags[$i] = utf8_strtolower(trim($tags[$i]));
|
$tags[$i] = utf8_strtolower(trim($tags[$i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user