Skip to content

Fix for #4693 - Problem with import XML#4744

Open
rafinhamvieira wants to merge 1 commit intonilsteampassnet:masterfrom
rafinhamvieira:hotfix/import_xml
Open

Fix for #4693 - Problem with import XML#4744
rafinhamvieira wants to merge 1 commit intonilsteampassnet:masterfrom
rafinhamvieira:hotfix/import_xml

Conversation

@rafinhamvieira
Copy link
Copy Markdown

I updated the code for fix the bug when i try to import XML from keepass

Copy link
Copy Markdown
Owner

@nilsteampassnet nilsteampassnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit is not signed

'pw_iv' => '',
'url' => empty($item['url']) === true ? '' : substr($item['url'], 0, 500),
'id_tree' => is_null($item['folder_id']) === true ? $targetFolderId : (int) $item['folder_id'],
'id_tree' => isset($post_folders[$item['parentFolderId']]['id']) ? (int)$post_folders[$item['parentFolderId']]['id'] : 0,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $post_folders is not defined in this case
I don't the interest of this change as it will break the execution.

$params = [
'title' => (string) $currentFolder,
'parent_id' => (int) $parentId,
'parent_id' => isset($parentId) && $parentId !== null ? $parentId : 0,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is correct.
Missing the (int)

prefixTable('nested_tree'),
array(
'parent_id' => $parentId,
'parent_id' => isset($parentId) && $parentId !== null ? $parentId : 0,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed as $parentId is set by function parameter.
As a consequence, it is always defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants