Skip to content

Commit

Permalink
- Enabled 'strict matching' i.e changed != to !==
Browse files Browse the repository at this point in the history
- If the library user has their 'bitbucket' 'root_name'
similar to their 'repo_name', str_pos() will return 0
as the first occurrence position.

- Without strict matching

echo strpos("epitome/epitome", "epitome") != false ? "TRUE" : "FALSE";

will evaluate to "FALSE".  Which is buggy. Hence recieving the error
(Can't find any repo with the name {epitome} for BitBucket in your config file.)

- Strict matching solves the silent bug.
  • Loading branch information
Steven Mwesigwa committed Jul 6, 2020
1 parent 73e89a3 commit f691d79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ftpbucket/BBjson.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function load_config() {
// --- Checks if the repo from BB match one of yours --- //
// Loop through configs and find a matching one
foreach ( $config['repos'] as $repo ) {
if ( strpos($payload_repo_name, $repo['repo_name']) != false && $repo['repo_host'] == 'bitbucket' ) {
if ( strpos($payload_repo_name, $repo['repo_name']) !== false && $repo['repo_host'] == 'bitbucket' ) {
$this->config->ftp = $repo;
$check++;
}
Expand Down

0 comments on commit f691d79

Please sign in to comment.