title: Codeigniter Filter Output for URL Use
body: <p>I may be thinking too much on this, but let's say I have a Website field on database. I've used strip_tags to strip all HTML tags. But if the user inputs this</p>
  
  <p>javascript:alert('test')</p>
  
  <p>It will get passed since it's a string. But then, the HTML will generate</p>
  
  <pre><code>&lt;a href="&lt;?php echo prep_url($website);?&gt;"&gt;Website&lt;/a&gt; //the code in view file
  &lt;a href="javascript:alert('test')"&gt;Website&lt;/a&gt; //bad
  </code></pre>
  
  <p>and the Javascript will execute if clicked. Notice too the prep_url doesn't work.</p>
  
  <p>Any suggestion? I've looked at HTMLPurifier, but it is quite big on size and I don't really want to do some major change.</p>
  
  <p>Thanks</p>