Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-17116

Useless duplicate conditions in ucp_pm_history.html

    XMLWordPrintable

Details

    Description

      Here is a code from ucp_pm_history.html

       

                  <!-- DEFINE $SHOW_PM_HISTORY_POST_BUTTONS = (history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE) -->
                  <!-- EVENT ucp_pm_history_post_buttons_list_before -->
                  <!-- IF $SHOW_PM_HISTORY_POST_BUTTONS -->
                  <ul class="post-buttons">
                      <!-- EVENT ucp_pm_history_post_buttons_before -->
                      <!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE -->
                      <li>
                          <a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}', {time:{history_row.MESSAGE_TIME},user_id:{history_row.USER_ID}});"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}" class="button button-icon-only">
                              <i class="icon fa-quote-left fa-fw" aria-hidden="true"></i><span class="sr-only">{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span>
                          </a>
                      </li>
                      <!-- ENDIF -->
                      <!-- EVENT ucp_pm_history_post_buttons_after -->
                  </ul>
                  <!-- ENDIF -->
                  <!-- EVENT ucp_pm_history_post_buttons_list_after --> 

       

      The condition history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE appears twice.

       

      It appears the second time inside a block whose the condition is the variable $SHOW_PM_HISTORY_POST_BUTTONS. And when that variable is true? Precisely when the condition history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE returns true!

       

      DEFINE $SHOW_PM_HISTORY_POST_BUTTONS = (history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE)

      The redundant condition check should be removed.

       

      Attachments

        Activity

          People

            Crizzo Crizzo
            Big Monstro Big Monstro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: