Skip to content

Commit

Permalink
Add comment about efficiency of api_add_trailing_slash() - refs BT#12885
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Jul 15, 2017
1 parent 6f64088 commit 9b810dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main/inc/lib/api.lib.php
Expand Up @@ -986,6 +986,8 @@ function api_is_facebook_auth_activated() {
*/
function api_add_trailing_slash($path) {
return substr($path, -1) == '/' ? $path : $path.'/';
// This code is about 20% faster than the preg_replace equivalent
//return preg_replace('/([^\/])$/', '$1/', $path);
}

/**
Expand Down

0 comments on commit 9b810dc

Please sign in to comment.