Giter VIP home page Giter VIP logo

Comments (4)

danieldjewell avatar danieldjewell commented on September 6, 2024

Goededag @joostdekeijzer!

You were absolutely correct about the "=" -- the ultimate problem appears to stem from here: f950190

Combined with the use of an empty string as the "value" for the $args associative array as I referenced in #485 - this results in the argument being "--private=" instead of "--private"

It would appear that the design of OccRunner::run (at 69) specifically takes into account this situation and tests whether the key of the array starts with "--" ... it even uses the "===" operator to test if the "--" is not found. If it is not found, it doesn't use an "=".

This would be consistent with designing OccRunner::run() to expect associative arrays (with the key set to "--key") for --key=value pairs and simple array elements for simple --arg parameters.

https://github.com/owncloud/updater/blob/master/src/Utils/OccRunner.php#L73-L80

Consider:

$args = array('--output' => 'json', '--private', '--something', '--hello', '--debug' => 'true');
print_r($args);

Output:

Array
(
    [--output] => json
    [0] => --private
    [1] => --something
    [2] => --hello
    [--debug] => true
)

In this case, https://github.com/owncloud/updater/blob/master/src/Utils/OccRunner.php#L74 would test "FALSE" for all but the first and last elements and would fall-through to https://github.com/owncloud/updater/blob/master/src/Utils/OccRunner.php#L77.

So I guess the question becomes, is the design of OccRunner::run() not correct or is the offending code in my pull #485 the problem? I believe it's the code in ConfigReader::runJson():109 that's the issue. But it all depends on whether or not run()'s parsing code is working as intended.

from updater.

PVince81 avatar PVince81 commented on September 6, 2024

@VicDeo

from updater.

danieldjewell avatar danieldjewell commented on September 6, 2024

I think this should be resolved against [master] (PR #485) and [stable10] (PR #500) ... Not sure if there are other branches that need this.

from updater.

VicDeo avatar VicDeo commented on September 6, 2024

Should be fixed with #500
please reopen if it is not

from updater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.