get_user_meta destroys backslashes!!!
-
Hello friends!
I have a form in my wordpress environment
<form action="" method="post"> <textarea name="message"></textarea> <input type="submit" value="Post" /> </form>
After submitting the form, I receive and store the data with
$all_data_ever_posted = get_user_meta( $user_id, 'all_data_ever_posted', true ); if($_POST["message"]) { $all_data_ever_posted[] = stripslashes($_POST["message"]); update_user_meta($user_id, 'all_data_ever_posted', $all_data_ever_posted); }
When I enter normal things without backslashes and so on, everything is fine and the thing is stored in the database.
But if I enter e.g. “\test”, the $_POST is rightly transported and put into the array. But when i update the user_meta and get_user_meta the next time, the “\” is gone!What am i doing wrong?
Please tell me the correct way to store special characters in the custom fields of wordpress.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘get_user_meta destroys backslashes!!!’ is closed to new replies.