Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replace join() by implode()
  • Loading branch information
dregad committed Aug 25, 2019
1 parent cb2343b commit 9f9852c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/category_api.php
Expand Up @@ -262,7 +262,7 @@ function category_remove_all( $p_project_id, $p_new_category_id = 0 ) {
return true;
}

$t_category_ids = join( ',', $t_category_ids );
$t_category_ids = implode( ',', $t_category_ids );

# update bug history entries
$t_query = 'SELECT id, category_id FROM {bug} WHERE category_id IN ( ' . $t_category_ids . ' )';
Expand Down
2 changes: 1 addition & 1 deletion core/graphviz_api.php
Expand Up @@ -416,7 +416,7 @@ function _build_attribute_list( array $p_attributes ) {
$t_result[] = $t_name . '=' . $t_value;
}

return '[ ' . join( ', ', $t_result ) . ' ]';
return '[ ' . implode( ', ', $t_result ) . ' ]';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion core/helper_api.php
Expand Up @@ -489,7 +489,7 @@ function helper_project_specific_where( $p_project_id, $p_user_id = null ) {
} else if( 1 == count( $t_project_ids ) ) {
$t_project_filter = ' project_id=' . reset( $t_project_ids );
} else {
$t_project_filter = ' project_id IN (' . join( ',', $t_project_ids ) . ')';
$t_project_filter = ' project_id IN (' . implode( ',', $t_project_ids ) . ')';
}

return $t_project_filter;
Expand Down
4 changes: 2 additions & 2 deletions core/layout_api.php
Expand Up @@ -529,7 +529,7 @@ function layout_navbar_projects_menu() {
echo '</a>' . "\n";

echo '<ul id="projects-list" class=" dropdown-menu dropdown-menu-right dropdown-yellow dropdown-caret dropdown-close">' . "\n";
layout_navbar_projects_list( join( ';', helper_get_current_project_trace() ), true, null, true );
layout_navbar_projects_list( implode( ';', helper_get_current_project_trace() ), true, null, true );
echo '</ul>' . "\n";
echo '</li>' . "\n";
}
Expand Down Expand Up @@ -636,7 +636,7 @@ function layout_navbar_subproject_option_list( $p_parent_id, $p_project_id = nul

foreach( $t_project_ids as $t_id ) {
if( $p_trace ) {
$t_full_id = join( $p_parents, ";" ) . ';' . $t_id;
$t_full_id = implode( $p_parents, ";" ) . ';' . $t_id;
} else {
$t_full_id = $t_id;
}
Expand Down
6 changes: 3 additions & 3 deletions core/news_api.php
Expand Up @@ -209,7 +209,7 @@ function news_get_rows( $p_project_id, $p_global = true ) {
$c_project_id = $t_projects[0];
$t_query .= ' WHERE project_id=\'$c_project_id\'';
} else {
$t_query .= ' WHERE project_id IN (' . join( $t_projects, ',' ) . ')';
$t_query .= ' WHERE project_id IN (' . implode( $t_projects, ',' ) . ')';
}

$t_query .= ' ORDER BY date_posted DESC';
Expand Down Expand Up @@ -283,7 +283,7 @@ function news_get_limited_rows( $p_offset, $p_project_id = null ) {
$t_query .= ' WHERE project_id=' . db_param();
$t_params = array( $c_project_id );
} else {
$t_query .= ' WHERE project_id IN (' . join( $t_projects, ',' ) . ')';
$t_query .= ' WHERE project_id IN (' . implode( $t_projects, ',' ) . ')';
$t_params = null;
}

Expand All @@ -306,7 +306,7 @@ function news_get_limited_rows( $p_offset, $p_project_id = null ) {
$t_query .= ' AND project_id=' . db_param();
$t_params[] = $c_project_id;
} else {
$t_query .= ' AND project_id IN (' . join( $t_projects, ',' ) . ')';
$t_query .= ' AND project_id IN (' . implode( $t_projects, ',' ) . ')';
}
$t_query .= ' ORDER BY announcement DESC, id DESC';
$t_result = db_query( $t_query, $t_params, $t_news_view_limit, $c_offset );
Expand Down
2 changes: 1 addition & 1 deletion core/print_api.php
Expand Up @@ -653,7 +653,7 @@ function print_subproject_option_list( $p_parent_id, $p_project_id = null, $p_fi
}

if( $p_trace ) {
$t_full_id = join( $p_parents, ';' ) . ';' . $t_id;
$t_full_id = implode( $p_parents, ';' ) . ';' . $t_id;
} else {
$t_full_id = $t_id;
}
Expand Down
2 changes: 1 addition & 1 deletion core/string_api.php
Expand Up @@ -294,7 +294,7 @@ function string_sanitize_url( $p_url, $p_return_absolute = false ) {
}

if( !empty( $t_clean_pairs ) ) {
$t_query = '?' . join( '&', $t_clean_pairs );
$t_query = '?' . implode( '&', $t_clean_pairs );
}
}

Expand Down

0 comments on commit 9f9852c

Please sign in to comment.