Commit cd7dddc
The previous parser used `sed "s/.*'//; s/'.*//"` which is greedy: for
a normal line `$table_prefix = 'wp_';`, the first sed matches up to and
including the closing single-quote, leaving just `;`. This broke step
6 silently — the URL-update query became `SELECT ... FROM ;options`,
mysql errored out under suppressed stderr, and the staging URL never
applied to the destination database.
Switch to `awk -F"'" '/^\$table_prefix[[:space:]]*=/ {print $2; exit}'`
which is robust against whitespace variants and unaffected by the
greedy-matching pitfall. Add empty-check and `[A-Za-z0-9_]+` validation
since the prefix is interpolated unquoted into SQL during step 6.
Bumps VERSION to 0.0.1.3.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f16debb commit cd7dddc
3 files changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | | - | |
212 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
219 | 232 | | |
220 | 233 | | |
221 | 234 | | |
| |||
0 commit comments