php.net |  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
Status: Closed Package: PostgreSQL related
PHP Version: 4.3.3 OS: *
Private report: No CVE-ID:
 [2003-10-23 05:50 UTC] edechaux at irci dot fr
Description:
------------
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 ?


Thanks.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] helly@php.net
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] sniper@php.net
Marcus, can you MFH now..?

 [2003-11-25 17:21 UTC] iliaa@php.net
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 http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

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


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 09:02:28 2014 UTC