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

CID Superfecta improper result format from Can411

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 14
    • Fix Version/s: None
    • Component/s: CID Superfecta
    • Labels:
      None
    • ToDo:
    • Asterisk Version:
      16.6.2
    • Distro Version:
      14.0.13.23
    • Distro:
      FreePBX Distro

      Description

      Sending (for example) 2042374134 into CID Superfecta when one of the methods is Can411 returns the following string: 

      Santa Lucia Pizza4 St Mary's Rd, Winnipeg, MB   R2H 1H1 

      There is no space before the address and there are supurious characters in the address.

      The lack of space before the address is caused by completely stripping out newlines instad of changing them to a space. The spurious characters in the address are caused by   entities in the value returned from canada411.ca.

      I propose the following fixes to modules/superfecta/includes/superfecta_base.php:

      At lines 1321 and 1350, change the preg_replace to use a '+' match modifer and replace matches with space instead of an empty string, as follows:

      From:  preg_replace('/[\n\r\t]*/i', '', $value)
      To:  preg_replace('/[\n\r\t]+/i', ' ', $value)

      At line 1350, add a new line to replace   entities with spaces:

      match[$index] = preg_replace('/ /i', ' ', $match[$index]);

      I have implemented these changes on my own system and they are working well.
       

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ehelpwpg E-Help Winnipeg
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  NextupJiraPlusStatus

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