# Adding E_WARNING to pg_unescape_bytea()

- Thread: https://externals.io/message/68017
- Original archive: https://news-web.php.net/php.internals/68017
- Started by Yasuo Ohgaki on 2013-06-29T02:46:07+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #68017 — Yasuo Ohgaki — 2013-06-29T02:46:07+00:00

URL: https://externals.io/message/68017#68017

Hi all,

pg_unescape_bytea() should raise error for invalid inputs
https://bugs.php.net/bug.php?id=65165

We need to discuss if E_WARING is proper, which branch should be
changed.

It will not break working code, so I would like to use `E_WARNING` and
change it from PHP 5.4.

Any comments?

Regards,

--
Yasuo Ohgaki
yohgaki@ohgaki.net

---

## #68030 — Matteo Beccati — 2013-07-02T07:56:39+00:00

URL: https://externals.io/message/68017#68030 · In reply to: #68017

Hi Yasuo,

> pg_unescape_bytea() should raise error for invalid inputs
> https://bugs.php.net/bug.php?id=65165
> 
> We need to discuss if E_WARING is proper, which branch should be
> changed.
> 
> It will not break working code, so I would like to use `E_WARNING` and
> change it from PHP 5.4.

Raising an `E_WARNING` will most likely mean that it needs to be
suppressed in some way, which I think is not necessary.

I'm all for returning false when the input is invalid. However, given
the behaviour change, I suppose it would be PHP 5.next material.


Cheers
-- 
Matteo Beccati

Development & Consulting - http://www.beccati.com/

---

## #68034 — Yasuo Ohgaki — 2013-07-02T10:34:34+00:00

URL: https://externals.io/message/68017#68034 · In reply to: #68030

Hi Matteo,

2013/7/2 Matteo Beccati <php@beccati.com>

> Raising an `E_WARNING` will most likely mean that it needs to be
> suppressed in some way, which I think is not necessary.
>
> I'm all for returning false when the input is invalid. However, given
> the behaviour change, I suppose it would be PHP 5.next material.
>

If pg_unecape_bytea() returns FALSE, it means there is obvious bug
or some kind of attack.

Users should be prepared for unexpected errors not only pg_escape_bytea()
but also many other functions anyway.

It does not hart any application, so it's good to have 5.5. IMHO.

Regards,

--
Yasuo Ohgaki
yohgaki@ohgaki.net
