Questions tagged [stripslashes]

A PHP library function for un-quoting a quoted string or paraphrased stripping slashes from a string. Questions are about the workings or issues with the stripslashes function.

Un-quotes a quoted string. The function returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\) are made into a single backslash ().

Example (from PHP manual)

<?php
$str = "Is your name O\'reilly?";

// Outputs: Is your name O'reilly?
echo stripslashes($str);
?>

Links

108 questions
1
vote
1 answer

RIPS PHP Code scanner

Call triggers vulnerability in function children() 389: ⇑ $this->children ($relativePath) 384: $relativePath = htmlspecialchars($_POST['path']); requires: 385: if(isset($_SESSION[Filescontroller::FC_USERNAME]) && !is_null($folderName) &&…
Prashanth Kumar B
  • 566
  • 10
  • 25
1
vote
1 answer

Embed Image issue strip slash

I have a script which inputs form data then generates an email to the user who completes the form. The email goes to the email recipient all fine, but the image does not show.( I get a broken link icon in Mail). I looked at the source code of the…
AdamMc
  • 205
  • 2
  • 7
  • 24
1
vote
5 answers

Antidote for magic_quotes_gpc()?

I've seen dozens of PHP snippets that go like this: function DB_Quote($string) { if (get_magic_quotes_gpc() == true) { $string = stripslashes($string); } return mysql_real_escape_string($string); } What happens if I call…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
1
vote
1 answer

Escaping apostrophes in wordpress

I wrote a plugin for wordpress that stores restaurant menu items. But whenever apostrophes are used, wordpress escapes them with slashes on both the admin and front end and keeps adding slashes to the text on every save. This is an excerpt and…
er777
  • 11
  • 1
  • 3
1
vote
1 answer

PHP variable is messing up img input

In my code I am having PHP write a variable into a text file. $stringData = '

' . $content . '

'; fwrite($fh, $stringData); The variable $content includes this But when the…
Spencer May
  • 4,266
  • 9
  • 28
  • 48
1
vote
2 answers

Why am I getting gibberish characters?

I'm making a PHP script to reverse the text within an HTML document to handle badly converted Hebrew PDFs. (sigh :)) Everything works, however the script has a very strange output. Only SOME of the characters, instead of staying Hebrew letters, turn…
pilau
  • 6,635
  • 4
  • 56
  • 69
1
vote
2 answers

Effectiveness of stripslashes against SQL Injection?

Possible Duplicate: Best way to defend against mysql injection and cross site scripting How to include a PHP variable inside a mysql insert statement I was wondering if anyone had came across the stripslashes statement when getting text from a…
Raven Danes
  • 37
  • 1
  • 2
0
votes
1 answer

php array_walk_recursive not working on mysql result set array with stripslashes

I have a mysql result array and I'm trying to stripslashes on the array using array_walk. It's not stripping slashes from mysql. It is working on the array I manually added ($dataArr['xxx']) though. Here is my code: $sql = ' select * from `ads`…
EricP
  • 1,459
  • 6
  • 33
  • 55
0
votes
3 answers

stripslashes issue when character after two backslashes

I know it's stupid question, but I cannot to google anything for my problem. I have $q = "This is\\same text"; and do $q = stripslashes($q); So, $q is now equal to "This issame text"! How I can to save one backslash? Thank you.
Guy Fawkes
  • 2,313
  • 2
  • 22
  • 39
0
votes
1 answer

Show returns from textarea on output from mySQL

All, I have a textarea that someone can type in. When I submit the form and insert in into my database I do it like this: $textarea = mysql_real_escape_string($_POST['textarea']); When I display the output I do it like this: echo…
user1048676
  • 9,756
  • 26
  • 83
  • 120
0
votes
1 answer

Strip slashes from database request correctly

I have message stored in my database containing a slash: e.g. don\'t To present the message I use this procedure. The thing is the backslash is still displayed. How can I get rid of it. I have tried many things, and read several postings here, but…
Mark Henry
  • 2,649
  • 7
  • 40
  • 48
0
votes
1 answer

eBay API/XML issues with slashes and htmlentities

I setup a local server using EasyPHP 5.3.8.1 - on it, I wrote a bunch of eBay API/XML stuff to post items to eBay. Everything works perfectly when using my local server. However, when I upload the php files to my webspace, when submitting the items…
jft
  • 1
0
votes
1 answer

another stripslashes problem

I didnt find a real solution for this. As many others now I use a jquery wysiwyg editor and save the output in mysql. The problem occurs when I load back into editor and save it again. The backslash and the " marks increasing every time when I press…
szatti1489
  • 352
  • 2
  • 5
  • 16
0
votes
0 answers

Striping slashes except if a user enters file directory path in string like C:\test\

Is there a way to use stripslashes() without removing slashes if the string contains a file directory path? $string = "C:\test\"; echo stripslashes($string);
Cesar Bielich
  • 4,754
  • 9
  • 39
  • 81
0
votes
0 answers

In Which Order Do I Deal With User Inputs To My Webform?

Q1. Do I validate user inputs first then sanitize it or should I vice versa ? if($_SERVER['REQUEST_METHOD'] == "POST") { if(ISSET($_POST['domain_email']) && ISSET($_POST['password'])) { //Initialise variables before…