Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-18021

RESTful Api module does not work correctly under PHP 5.6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: RESTful API
    • Labels:
      None
    • ToDo:
    • Asterisk Version:
      13.22
    • Distro Version:
      14.0.3.13
    • Distro:
      FreePBX Distro

      Description

      Dear support,

      member function _"get_req" of "Api" class in restapi/functions.inc/api.class.php has an issue concerning the initialization of $this->req->token_opts. This property is initially undefined and some subproperties, like "allow" and "deny", could be initialized to null triggering a "create default object from empty" exception in PHP 5.6.

      Perhaps, it should be added a statement like this

      $opts = restapi_tokens_get($this->req->token, 'token');

      if ($opts) {
      $this->req->token_opts = isset($this->req->token_opts) ? $this->req->token_opts : new stdClass;
      foreach ($opts as $k => $v)

      { $this->req->token_opts->$k = $v; }

      to fix this issue and avoiding the triggering of exception.

      We make a deep use of RESTful API in our deployment and this bug prevents us from migrating to FreePBX 14.

      Thank you in advance and best regards,

      Camillo

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cesia cesia
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  NextupJiraPlusStatus

                  Error rendering 'slack.nextup.jira:nextup-jira-plus-status'. Please contact your Jira administrators.