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;
|
||||
|
||||
for ($i = 0; $i < $tags_count; $i++) {
|
||||
foreach($tags as $i => $tag) {
|
||||
$tags[$i] = trim(utf8_strtolower($tags[$i]));
|
||||
if ($fromApi) {
|
||||
include_once 'SemanticScuttle/functions.php';
|
||||
|
@ -144,7 +144,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService
|
||||
$tags = utf8_strtolower(trim($tags));
|
||||
} else {
|
||||
$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]));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user