Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-1232

Calling AppModel methods with default params via API results in error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Attempting to invoke AppModel::systemEncrypt() via the Encryption model results in a Failed to retrieve the default value error. This is a result of the following lines in /app/controllers/api.php:

      $method_params[$param->name] = $param->getDefaultValue();
      

      It appears that ionCube may be causing the ReflectionParameter::getDefaultValue() method from detecting the default value.

      curl https://yourdomain.com/installpath/api/encryption/systemEncrypt.json -u username:key -d 'value=my text'
      

      Important to note that this issue does not happen if you specify all parameters to a method, call a method that has no default parameters, or call a method that lives outside of any ioncube encoded file.

        Issue Links

          Activity

          cody Cody Phillips (Inactive) created issue -
          cody Cody Phillips (Inactive) made changes -
          Field Original Value New Value
          Description Attempting to invoke AppModel::systemEncrypt() via the Encryption model results in a *Failed to retrieve the default value* error. This is a result of the following lines in /app/controllers/api.php:

          {noformat}
          $method_params[$param->name] = $param->getDefaultValue();
          {noformat}

          It appears that ionCube may be causing the ReflectionParameter::getDefaultValue() method from detecting the default value.

          {noformat}
          curl https://yourdomain.com/installpath/api/encryption/systemEncrypt.json -u username:key -d 'value=my text'
          {noformat}
          Attempting to invoke AppModel::systemEncrypt() via the Encryption model results in a *Failed to retrieve the default value* error. This is a result of the following lines in /app/controllers/api.php:

          {noformat}
          $method_params[$param->name] = $param->getDefaultValue();
          {noformat}

          It appears that ionCube may be causing the ReflectionParameter::getDefaultValue() method from detecting the default value.

          {noformat}
          curl https://yourdomain.com/installpath/api/encryption/systemEncrypt.json -u username:key -d 'value=my text'
          {noformat}

          Important to note that this issue does not happen if you specify all parameters to a method, call a method without default parameters, or call a method that lives outside of any ioncube encoded file.
          cody Cody Phillips (Inactive) made changes -
          Description Attempting to invoke AppModel::systemEncrypt() via the Encryption model results in a *Failed to retrieve the default value* error. This is a result of the following lines in /app/controllers/api.php:

          {noformat}
          $method_params[$param->name] = $param->getDefaultValue();
          {noformat}

          It appears that ionCube may be causing the ReflectionParameter::getDefaultValue() method from detecting the default value.

          {noformat}
          curl https://yourdomain.com/installpath/api/encryption/systemEncrypt.json -u username:key -d 'value=my text'
          {noformat}

          Important to note that this issue does not happen if you specify all parameters to a method, call a method without default parameters, or call a method that lives outside of any ioncube encoded file.
          Attempting to invoke AppModel::systemEncrypt() via the Encryption model results in a *Failed to retrieve the default value* error. This is a result of the following lines in /app/controllers/api.php:

          {noformat}
          $method_params[$param->name] = $param->getDefaultValue();
          {noformat}

          It appears that ionCube may be causing the ReflectionParameter::getDefaultValue() method from detecting the default value.

          {noformat}
          curl https://yourdomain.com/installpath/api/encryption/systemEncrypt.json -u username:key -d 'value=my text'
          {noformat}

          Important to note that this issue does not happen if you specify all parameters to a method, call a method that has no default parameters, or call a method that lives outside of any ioncube encoded file.
          cody Cody Phillips (Inactive) made changes -
          Security Private [ 10000 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.2.1 [ 10504 ]
          Fix Version/s 3.1.4 [ 10500 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.3.0 [ 10100 ]
          Fix Version/s 3.2.0 [ 10502 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.2.2 [ 10505 ]
          Fix Version/s 3.2.1 [ 10504 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.2.3 [ 10506 ]
          Fix Version/s 3.2.2 [ 10505 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.3.0-b2 [ 10507 ]
          Fix Version/s 3.3.0-b1 [ 10100 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.3.0 [ 10508 ]
          Fix Version/s 3.3.0-b2 [ 10507 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.4.0 [ 10400 ]
          Fix Version/s 3.3.0 [ 10508 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.3.0 [ 10508 ]
          Fix Version/s 3.2.3 [ 10506 ]
          tyson Tyson Phillips (Inactive) made changes -
          Fix Version/s 3.3.0 [ 10508 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0 [ 10401 ]
          Fix Version/s 3.4.0-b1 [ 10400 ]
          cody Cody Phillips (Inactive) made changes -
          Rank Ranked higher
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0-b2 [ 10701 ]
          Fix Version/s 3.5.0-b1 [ 10401 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0-b2 [ 10701 ]
          cody Cody Phillips (Inactive) made changes -
          Rank Ranked higher
          Hide
          cody Cody Phillips (Inactive) added a comment -

          This is caused by ioncube. Outside of our control.

          Show
          cody Cody Phillips (Inactive) added a comment - This is caused by ioncube. Outside of our control.
          cody Cody Phillips (Inactive) made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Won't Fix [ 2 ]
          tyson Tyson Phillips (Inactive) made changes -
          Status In Review [ 5 ] Closed [ 6 ]
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue relates to CORE-2841 [ CORE-2841 ]

            People

            • Assignee:
              cody Cody Phillips (Inactive)
              Reporter:
              cody Cody Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: