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

make_clickable() function does not apply custom classes

    XMLWordPrintable

    Details

      Description

      If a serial call is being made like{{}}

      make_clickable('http://localhost/phpBB3/index.php', false, 'class1'); make_clickable('http://localhost/phpBB3/index.php', false, 'class2'); make_clickable('http://localhost/phpBB3/index.php', false, 'class3');

      {{}}you'll always get the same result as with the 1st call 

      <!-- l --><a class="class1-local" href="http://localhost/331/index.php">index.php</a><!-- l -->

       
      The cause is that static array $magic_url_match_args is just got appended with every call so preg_replace_callback()}}applies the 1st suitable regex which is always {{class1 related.
       
      Also if one more call with email got appended, f.e. {{}}

      make_clickable('test@email.com', false, 'class4'); 

      the result will be multiplied by all make_clickable() calls, like 

      <!-- e --><a href="mailto:test@email.com"><!-- e --><a href="mailto:test@email.com"><!-- e --><a href="mailto:test@email.com"><!-- e --><a href="mailto:test@email.com">test@email.com</a><!-- e --></a><!-- e --></a><!-- e --></a><!-- e -->

        Attachments

          Activity

            People

            Assignee:
            Marc Marc
            Reporter:
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: