reza baher
reza baher

Reputation: 1

using override_function to add utf-8 to all of htmlenteties calls

I have an script that i want to change to Persian but this script has written by my colleague and he used htmlentities without utf-8 as argument.

I decided to use override_function and runkit , i managed to install runkit on my php and it works but cant figure out how to change this

htmlentities(LABEL__MAIN_INDEX_ADMIN, ENT_QUOTES)

to

htmlentities(LABEL__MAIN_INDEX_ADMIN, ENT_QUOTES , "UTF-8")

i know that i can use override to change htmlentities so when i call it utf-8 will be added automatically ! please help me

Upvotes: -1

Views: 51

Answers (1)

reza baher
reza baher

Reputation: 1

i found the answer !

runkit_function_copy('htmlentities','htmlentities2'); runkit_function_redefine ('htmlentities', '$string,$compat=NULL,$enc="UTF-8"', 'return htmlentities2($string,$compat,$enc);');

this works like charm !! thanks anyway !

Upvotes: 0

Related Questions