Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel::System::YAML: parsing of 0, '0', or '' #2462

Closed
bschmalhofer opened this issue Aug 14, 2023 · 1 comment
Closed

Kernel::System::YAML: parsing of 0, '0', or '' #2462

bschmalhofer opened this issue Aug 14, 2023 · 1 comment
Assignees
Labels
tidying Tidying of the code
Milestone

Comments

@bschmalhofer
Copy link
Contributor

In Kernel/System/YAML.pm there is the following blurb:

    # There is a currently a problem with YAML loader it cant load YAML representations of:
    #   0, '0' or ''.
    # This workaround looks for this special cases and returns the correct value without using the
    #   loader
    if ( $Param{Data} =~ m{\A---[ ](?: '0' | 0 )\n\z}msx ) {
        return 0;
    }
    elsif ( $Param{Data} eq "--- ''\n" ) {
        return '';
    }

This looks similar to #2458. I think that a similar fix can be applied here and the funny special cases can be avoided.

@bschmalhofer bschmalhofer added the tidying Tidying of the code label Aug 14, 2023
@bschmalhofer bschmalhofer added this to the OTOBO 11.0 milestone Aug 14, 2023
@bschmalhofer bschmalhofer self-assigned this Aug 14, 2023
bschmalhofer added a commit that referenced this issue Aug 15, 2023
The changes for issue #2464 broke the script. The reason was that
the previous version used Kernel::System::YAML for testing
and the changes script, using YAML::XS, did not fully replicate the
funktionality in Kernel::System::YAML.
Furthermore there was some confusion regarding UTF8 de- and en-coding.
bschmalhofer added a commit that referenced this issue Aug 15, 2023
where the behavior actually changed. In essence, the fallback to YAML.pm
supported invalid YAML. Without the fallback the invalid YAML is no longer accepted.
bschmalhofer added a commit that referenced this issue Aug 15, 2023
with YAML from sysconfig_default.xml_content_parsed
bschmalhofer added a commit that referenced this issue Aug 15, 2023
for checking YAML::XS::Load(). Thus the special cases,
for YAML that return false values, are no longer needed.
bschmalhofer added a commit that referenced this issue Aug 15, 2023
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Aug 16, 2023

Test suite looks fine. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidying Tidying of the code
Projects
None yet
Development

No branches or pull requests

1 participant