 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
shwekhaw2 Smarty n00b
Joined: 29 Apr 2012 Posts: 2
|
Posted: Sun Apr 29, 2012 3:55 am Post subject: truncate part of the string |
|
|
Hi we like to truncate the credit card number in order detail. The problem is that number is not constant. VISA/MASTERCARD/DISCOVER all 16 digits but AMEX only 15 digits. So length varies with card type. Card number is part of larger string so we cannot exclude the whole string either. One fix thing is the text 'Card number: " which comes before the numbers.
Anyway we can find the match for that fixed text and truncate 12 digits after that whatever they may be?
Thanks in advance. |
|
| Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7036 Location: Lincoln Nebraska, USA
|
Posted: Sun Apr 29, 2012 4:06 am Post subject: |
|
|
| I would truncate this in PHP before being passed to Smarty, or even truncate at the DB level before getting to PHP. You don't want full credit card numbers assigned to the template, that is not a secure approach to sensitive data. |
|
| Back to top |
|
shwekhaw2 Smarty n00b
Joined: 29 Apr 2012 Posts: 2
|
Posted: Sun Apr 29, 2012 4:37 am Post subject: |
|
|
| This is on the admin side. They are encrypted in database and we store only for certain period. But we do need to show on admin side for some admin account. We want to truncate them for low level admin account. I am looking for answer if we can do this on smarty side. |
|
| Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7036 Location: Lincoln Nebraska, USA
|
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|