|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25963 postgres error message include \n characters
Submitted: 2003-10-23 05:50 UTC Modified: 2003-11-25 17:21 UTC
From: edechaux at irci dot fr Assigned: helly (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 4.3.3 OS: *
Private report: No CVE-ID: None
 [2003-10-23 05:50 UTC] edechaux at irci dot fr
When a connection to a Postgres database fails, the error message which is in the $php_errormsg variable ends with the following string : '\n\n.'

The final '.' is quite anoying because you just can't 'trim' the $php_errormsg, you must 'trim ($php_errormsg, "\n.")' to remove the dot and the newline characters.

Could it be possible to remove the final dot, or even the final '\n\n.' string ?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-24 09:35 UTC] edechaux at irci dot fr
I tried with the lastest CVS and there is no changes.

Here is a sample code :

----file toto.php----
if (! pg_connect ('blablabla')) {
 echo '{' . $php_errormsg . '}';

I execute 'php toto.php'. It displays :

{Unable to connect to PostgreSQL server: missing "=" after "blablabla" in connection info string

As you can see there is a newline character between 'string' and '.'.

This newline character mess up the html code if you d'ont remove it...

It still works, but it break your html code format :p
 [2003-10-25 08:48 UTC]
Is already fixed in PHP 5. Fix will be committed for 4.3.5 or whatever comes next, too. For 4.3.3 we are to far in the release process.
 [2003-11-17 22:43 UTC]
Marcus, can you MFH now..?

 [2003-11-25 17:21 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 23:01:27 2024 UTC