php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65336 pg_escape_literal/identifier() silently returns boolean w/o connection
Submitted: 2013-07-25 16:20 UTC Modified: 2013-07-26 20:42 UTC
From: maja dot privat at gmx dot at Assigned: yohgaki (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 5.4.17 OS: Windows 7
Private report: No CVE-ID: None
 [2013-07-25 16:20 UTC] maja dot privat at gmx dot at
Description:
------------
This is the code-snipped:

$limit = "5";
print_r( array(pg_escape_literal($limit) , gettype(pg_escape_literal($limit))) );

And it prints:

[false,"boolean"]

However, the documentation says, that "pg_escape_literal()" returns only strings.
I'm not sure if it's a php-bug, or a documentation-error.

Documentation-Page:  http://www.php.net/manual/en/function.pg-escape-literal.php

Test script:
---------------
$limit = "5";
print_r( array(pg_escape_literal($limit) , gettype(pg_escape_literal($limit))) );


Expected result:
----------------
["'5'","string"]

Actual result:
--------------
[false,"boolean"]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-26 00:52 UTC] yohgaki@php.net
-Status: Open +Status: Assigned -Type: Documentation Problem +Type: Bug -Package: *General Issues +Package: PostgreSQL related -Assigned To: +Assigned To: yohgaki
 [2013-07-26 00:52 UTC] yohgaki@php.net
Should be a bug.
 [2013-07-26 20:42 UTC] yohgaki@php.net
-Summary: Function returns boolean, although documentation says it returns only strings +Summary: pg_escape_literal/identifier() silently returns boolean w/o connection
 [2013-07-26 20:53 UTC] yohgaki@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1d7b6970f20a059c501e68927c9fb874bdb226bc
Log: Fixed bug #65336
 [2013-07-26 20:53 UTC] yohgaki@php.net
-Status: Assigned +Status: Closed
 [2013-07-26 20:54 UTC] yohgaki@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ef3d813d2c8758a915e4efb2e53752f8800eab52
Log: Fixed bug #65336
 [2013-07-26 20:54 UTC] yohgaki@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d4aee1021e6a29f62dcb9c96e945a0fe710c8832
Log: Fixed bug #65336
 [2013-07-28 09:50 UTC] dmitry@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ef3d813d2c8758a915e4efb2e53752f8800eab52
Log: Fixed bug #65336
 [2013-07-31 12:35 UTC] dmitry@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1d7b6970f20a059c501e68927c9fb874bdb226bc
Log: Fixed bug #65336
 [2013-11-17 09:30 UTC] laruence@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d4aee1021e6a29f62dcb9c96e945a0fe710c8832
Log: Fixed bug #65336
 [2013-11-17 09:30 UTC] laruence@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ef3d813d2c8758a915e4efb2e53752f8800eab52
Log: Fixed bug #65336
 [2014-10-07 23:17 UTC] stas@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=1d7b6970f20a059c501e68927c9fb874bdb226bc
Log: Fixed bug #65336
 [2014-10-07 23:28 UTC] stas@php.net
Automatic comment on behalf of yohgaki
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=1d7b6970f20a059c501e68927c9fb874bdb226bc
Log: Fixed bug #65336
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 05 22:01:28 2024 UTC