# [PATCH] Bug #44251

- Thread: https://externals.io/message/40864
- Original archive: https://news-web.php.net/php.internals/40864
- Started by Tim Steiner on 2008-10-06T15:40:02+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #40864 — Tim Steiner — 2008-10-06T15:40:02+00:00

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

Greetings,

I have created a patch for Bug #44251 (Question mark and an escaped 
singel quote lead to an exception).

The issue was introduced by the fix for Bug #36798 (mysql error when 
using named parameters in a query with high ascii).  That fix ended up 
removing code that would ignore escaped quotes inside of quoted text. 
Instead, the parser would treat any escaped quotes as the end of the 
quoted string.  Therefore, if you have an escaped quote followed by a 
question mark, the parse thinks the question mark is a placeholder.

My patch updates the regular expressions used for finding quoted strings 
to properly ignore escaped quotes.  It also seems to handle the test 
case from Bug #36798 correctly.

This is my first patch submission, so I have some questions:
The patch is against 5.2.6.  Should it be against a different version?
I had to alter a .re file and a regenerated the .c file with re2c 
0.13.5.  Should I use a different version and if so where can I get it? 
  Should I even be submitting the updated .c file?

Thanks!
Tim Steiner

---

## #40874 — johannes@php.net — 2008-10-07T12:21:20+00:00

URL: https://externals.io/message/40864#40874 · In reply to: #40864

Hi,


> Greetings,
> 
> I have created a patch for Bug #44251 (Question mark and an escaped 
> singel quote lead to an exception).

Thanks, the test passed my initial tests, I'll commit it later today to
the branches.

> This is my first patch submission, so I have some questions:
> The patch is against 5.2.6.  Should it be against a different version?

In general: It would be perfect to provide a patch for all active
branches (HEAD/6.0, 5.3 and, as this is a bugfix, 5.2) against CVS. In
this case PDO doesn't differ too much between the branches so your patch
works directly so no work needed.

> I had to alter a .re file and a regenerated the .c file with re2c 
> 0.13.5.  Should I use a different version and if so where can I get it? 
>   Should I even be submitting the updated .c file?

re2c can be found at http://re2c.org 0.13.5 is the latest version and is
fine. And yes, providing the generated files in a patch helps people
testing (while everybody working in that area should have re2c
available)

> Thanks!

Thank you!

johannes
