Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As @cryptic pointed, it is a bug in the auto_link method. (<a href="https://github.com/EllisLab/CodeIgniter/blob/2.1-stable/system/helpers/url_helper.php#L423" rel="nofollow noreferrer">See source</a>) They are finding all email address in the output and then, they do a replace all (<code>str_replace</code>) with the anchored version. So...</p> <pre><code>&lt;p&gt;This is the address a@test.com&lt;/p&gt; &lt;p&gt;This is the second address ba@test.com&lt;/p&gt; </code></pre> <p>becomes</p> <pre><code>&lt;p&gt;This is the address &lt;a ...&gt;a@test.com&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is the second address b&lt;a ...&gt;a@test.com&lt;/a&gt;&lt;/p&gt; </code></pre> <p>on first pass for the email <code>a@test.com</code>. On the second e-mail, they try to replace <code>ba@test.com</code> with the anchored version, but the <code>str_replace</code> can not find the address, it has already been replaced.</p> <p>You could implement your own fix by :</p> <ol> <li>Extending the auto_link method of the URL helper. <a href="http://ellislab.com/codeigniter/user-guide/general/helpers.html" rel="nofollow noreferrer">See documentation</a></li> <li>Copy the auto_link method from the CodeIgniter source into that new Helper.</li> <li>Replace only the first occurrence of the string. <a href="https://stackoverflow.com/questions/1252693/php-str-replace-that-only-acts-on-the-first-match">See this SO thread</a>.</li> </ol> <p>For example: </p> <pre><code>$str = str_replace($matches['0'][$i], safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str); </code></pre> <p>becomes </p> <pre><code>$str = preg_replace('/' . $matches['0'][$i] . '/', safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str, 1); </code></pre> <p>That should fix it for you. I would advise against modifying the system's URL_Helper, you might run into some migration problems later on.</p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload