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

change the flag of htmlentities flag to ENT_IGNORE on the logfiles module

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 13
    • Fix Version/s: None
    • Component/s: Asterisk Logfiles
    • Labels:
      None

      Description

      Hello,

      We are getting an WHOOPS error when trying to load 50000 lines in the logfiles module. This is the error that I am getting from the web page:

      
      htmlspecialchars(): Invalid multibyte sequence in argument
      

       

      To solve this, I changed the flag of the htmlentities in the functions.inc.php file to ENT_IGNORE instead. probably because of the php version being used in the newer releases. Here is the code snippet from the functions.inc.php

      
      132         foreach($log as $l){
      133                 switch (true) {
      134                 case strpos($l, 'INFO'):
      135                         //$l = '<span class="beige">' . htmlentities($l,ENT_COMPAT | ENT_HTML401, "UTF-8") . '</span>';
      136                         $l = '<span class="beige">' . htmlentities($l,ENT_IGNORE , "UTF-8") . '</span>';
      137                         break;
      138                 case strpos($l, 'WARNING'):
      139                         //$l = '<span class="orange">' . htmlentities($l,ENT_COMPAT | ENT_HTML401, "UTF-8") . '</span>';
      140                         $l = '<span class="orange">' . htmlentities($l,ENT_IGNORE , "UTF-8") . '</span>';
      141                         break;
      142                 case strpos($l, 'DEBUG'):
      143                         //$l = '<span class="green">' . htmlentities($l,ENT_COMPAT | ENT_HTML401, "UTF-8") . '</span>';
      144                         $l = '<span class="green">' . htmlentities($l,ENT_IGNORE , "UTF-8") . '</span>';
      145                         break;
      146                 case strpos($l, 'UPDATE'):
      147                 case strpos($l, 'NOTICE'):
      148                         //$l = '<span class="cyan">' . htmlentities($l,ENT_COMPAT | ENT_HTML401, "UTF-8") . '</span>';
      149                         $l = '<span class="cyan">' . htmlentities($l,ENT_IGNORE , "UTF-8") . '</span>';
      150                         break;
      151                 case strpos($l, 'FATAL'):
      152                 case strpos($l, 'CRITICAL'):
      153                 case strpos($l, 'ERROR'):
      154                         //$l = '<span class="red">' . htmlentities($l,ENT_COMPAT | ENT_HTML401, "UTF-8") . '</span>';
      155                         $l = '<span class="red">' . htmlentities($l,ENT_IGNORE , "UTF-8") . '</span>';
      156                         break;
      157                 default:
      158                         $l = logfiles_highlight_asterisk(htmlentities($l, ENT_NOQUOTES,"UTF-8"),$channels);
      159                         break;
      160                 }
      161                 echo $l . '<br />';
      162         }
      

      Thank you,

      Daniel Friedman

      Trixton LTD.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                danielf danielf
              • 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.