Quantcast

r40119 - /trunk/phpgwapi/inc/class.egw_db.inc.php

classic Classic list List threaded Threaded
1 message Options
ralfbecker_sf ralfbecker_sf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

r40119 - /trunk/phpgwapi/inc/class.egw_db.inc.php

Author: ralfbecker
Date: Mon Aug 13 16:42:55 2012
New Revision: 40119

URL: http://svn.stylite.de/viewvc/egroupware?rev=40119&view=rev
Log:
only truncate string if length given and <= 255, to not unnecessary truncate varchar(>255) as PostgreSQL uses text anyway and MySQL truncates itself silently (unless strict mode!)

Modified:
    trunk/phpgwapi/inc/class.egw_db.inc.php

Modified: trunk/phpgwapi/inc/class.egw_db.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpgwapi/inc/class.egw_db.inc.php?rev=40119&r1=40118&r2=40119&view=diff
==============================================================================
--- trunk/phpgwapi/inc/class.egw_db.inc.php (original)
+++ trunk/phpgwapi/inc/class.egw_db.inc.php Mon Aug 13 16:42:55 2012
@@ -1463,7 +1463,9 @@
  {
  $value = implode($glue,$value);
  }
- if (!is_null($length) && strlen($value) > $length)
+ // only truncate string if length given and <= 255
+ // to not unnecessary truncate varchar(>255) as PostgreSQL uses text anyway and MySQL truncates itself silently (unless strict mode!)
+ if (!is_null($length) && $length <= 255 && strlen($value) > $length)
  {
  $value = substr($value,0,$length);
  }


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
eGroupWare-cvs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs
Loading...