OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



UTF-8 searches

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

UTF-8 searches

Postby jkacmarcik » Thu Feb 24, 2005 2:08 pm

We're in the process of setting up a journal that will include articles (in html) that include UTF-8 character encoding. Everything works well except the searching, so I fixed it.

includes/functions.inc.php:
line 128
Code: Select all
array_push($vars, htmlspecialchars($var));
becomes
Code: Select all
array_push($vars, str_replace('&', '&', htmlspecialchars($var)));


line 151
Code: Select all
array_push($vars, htmlspecialchars($var));
becomes
Code: Select all
array_push($vars, str_replace('&', '&', htmlspecialchars($var)));


htmlspecialchars() strips out html tags, slashes and ampersands -- however the ampersands are needed in UTF-8.

So, is there any reason that the ampersands can't be left alone? There shouldn't be any [new] security issues, if someone wanted to get an ampersand past as-is they could use a doubly encode one.

-jeffrey
jkacmarcik
 
Posts: 1
Joined: Thu Feb 24, 2005 1:47 pm

Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron