I'm developing a application using PHP 5.4, CakePHP 2.2.3. The problem is, in my local server (XAMPP) this error does not happen (PHP 5.4).
But in my server online, it does (PHP 5.3).
The error is that little weird character in the link:
Here: sgc/noticias/�avascript:void(0)
Most of the weird characters are data that are fetched through the database.
This does only happen when I use the link
method of the HtmlHelper
. Lets say, if I echo this:
echo $this->Html->link('Click me', '/pages/home', array('class' => 'button', 'target' => '_blank'));
I get this:
As you can see in the image: /sgc/index/�pages/home
If I echo this:
<a href="/sgc/index/pages/home" >Click me</a>
I get this: /sgc/index/pages/home
If I echo this:
echo $this->Html->link('Click me',array('controller'=>'pages', 'action' => 'view'), array('class' => 'button', 'target' => '_blank'));
I get this: /sgc/pages/view
I read something that this problem may be something like encoding problem, but I'm almost 100% sure all my files are encoding in UTF8 (without BOM).
Looks like this is the character: %EF%BB%BF.
Also, looking at the error log shows up this:
2012-11-21 15:37:05 Error: [MissingActionException] Action IndexController::�index() could not be found.
I don't think this problem could be related to the CakePHP version or some file in CakePHP lib, because I just uploaded a new CakePHP application without modifying anything (just a simple CakePHP app) and everything works fine in my online server.
The error must be in some of my files and not CakePHP.
Update
I followed this answer and have used the Total Commander to search for UTF BOM files in my project. But the results are, only images return in the search for "EF BB BF".