flourishlib / flourish-classes

The class files for Flourish
http://flourishlib.com
182 stars 78 forks source link

how to unescape strings? #141

Open unstoppablecarl opened 12 years ago

unstoppablecarl commented 12 years ago

how do you unescape strings and remove the linebreaking characters? using the unescape() method doesn't do anything to strings.

$db = fORMDatabase::retrieve();

$testString = 'foo

bar';

$escaped = $db->escape('string', $testString);

echo $escaped; // 'foo\n\n\n    bar'

// unescaping strings doesn't do anything to the string

$unescaped = $db->unescape('string', $escaped);

echo $unescaped; // 'foo\n\n\n    bar'
unstoppablecarl commented 12 years ago

the issue seems to be that $db->escape('string', $value); isn't the same as $db->query(' %s', $value);

$db->escape('string', $value) doesn't give proper line breaks and $db->query(' %s', $value); does