ludovicchabant/PieCrust — pull request #9 by tomaz (2011-11-10 07:13:33+00:00)
Title: Recapturing now works

Me again :) Finally updated to latest version and it broke my site as it didn't handle recapturing when using partial `post_url`. There were several issues with the code:

- First of all, `die()` prevented recapturing, so removed it.
- Then `str_replace` was missing third parameter (source string) when creating matching regex.
- Regex was using invalid matcher for slug (`\d{2}` only matches two digits, but slug is arbitrary string).
- Finally `preg_match` requires embedding regex within Perl style `/` chars.

I tested with my setup and works just fine, take a look. Didn't check unit tests as you proposed last time, I'm barely struggling with PHP and Apache, it took me a couple of hours to figure out this patch, so it seems too involving for my current time... :)

A couple more things to do, then I can make my PieCrust site live and finally ditch WordPress... Thanks!