Hello,
some of my clients have an apostrophe in their name. When I try to create an invoice, a copy of the client is generated: the new client name is trimmed to apostrophe (for example: if the original name is “ABCD’EFG” the duplicate client is “ABCD”; all other field are empty).
It seems there are not problems with other special characters.
It seems a duplicate of this issue: https://development.invoiceplane.com/browse/IP-301, but it should already have been fixed in previous releases…
My Invoiceplane version is 1.46; server Centos 6.5; PHP version 5.3.8
Same problem here, thought I checked the demo and does not happen in there. Maybe some local libraries issue?
I must specify that ih I use the apostrophe in other fileds (like address, city etc) it works normally.
Please upgrade your PHP version immediately! The PHP version is not supported anymore and leads to significant security issues and you should not use InvoicePlane then.
About this problem: it may be related to the PHP version. The field uses handling for special characters and should work properly.
But according to wiki php 5.3.0 is still supported!
If not, what version do I need?
Sure it is supported by InvoicePlane but seriously not recommended. Using PHP < 5.5 is a big security risk.
Just upgraded to php 5.5.34: the problem persists!
Anyway, it would be useful escaping special charaters while saving new clients, for example by substituting the apostrope character with a similar one.
I’m trying to tweak the code but I don’t know where I have to look (I’m not completely new to Codeigniter)
Hello,
I have the same problem here… Anybody find a solution ? Even using a string \ before the apostrophe is not working…
Thank you
I’m having the same problem, but it has worked in the past. Not sure why it is suddenly broken. My PHP is 5.5.3.
Hi, I managed to solve the problem with a little workaround:
Edit /application/core/My_Model.php at line 178 in this way:
public function save($id = NULL, $db_array = NULL)
{
if (!$db_array) {
$db_array = $this->db_array();
}
/* changes start here
if ( ($this->table=="ip_clients") && (isset($db_array['client_name'])) ):
$db_array['client_name']=str_replace("'", "’", $db_array['client_name']);
$db_array['client_name']=str_replace('"', '”', $db_array['client_name']);
endif;
*/ end of changes
$datetime = date('Y-m-d H:i:s');
if (!$id) {
// other code...
In this way, the system escapes special characters (’ or ") in client’s name before adding to database.
I tested this problem with 'Client' Name'("Test")
on the latest version of InvoicePlane (1.4.6) and everything works fine.
Hi there,
I can confirm I have the same issue in two instances running 1.4.8