pdox icon indicating copy to clipboard operation
pdox copied to clipboard

space

Open makhondi opened this issue 5 years ago • 4 comments

hi, Please check the following code: ` $values = array();

$values['string_text'] = " Hi"; // 4 Space

$string_id = 1;

$PDOx->table( 'strings' )->where( 'string_id', $string_id )->update( $values );

`

After implementation Field value [string_text] = " Hi" // 1 Space How to solve this problem?

makhondi avatar Aug 08 '19 09:08 makhondi

Hi @makhondi , Do you want to using 4 spaces for your data? Actually, all data are filtered by espace() method in PDOx. This method provide to remove space chars on the left and right of the value, and also apply quote() method in PDO for sql escaping and XSS blocking.

izniburak avatar Aug 08 '19 20:08 izniburak

Yes In fact, spaces and all the characters are of great value to us.

makhondi avatar Aug 15 '19 16:08 makhondi

Hi @makhondi , Maybe we can add a configuration to manage whether to trim data in PDOx. I'm not sure is this would be useful but we can still think.

Thanks.

izniburak avatar Aug 16 '19 10:08 izniburak

i have same problem. the 4 spaces was replaced into 1 space.

shaobingme avatar Apr 06 '22 03:04 shaobingme