Skip to content

Commit d1ff556

Browse files
committed
Fix CHANGELOG: SET overwrites GET parameters, not POST
1 parent 80da414 commit d1ff556

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
- **What changed**: Previously, `$x` would return a POST parameter value if no GET parameter named `x` existed.
77
- **Fix**: Replace `$x` with `:x` when you need to access form field values.
88
- **Example**: Change `SELECT $username` to `SELECT :username` when reading form submissions.
9-
- **BREAKING**: `SET $name` no longer overwrites POST parameters when a POST parameter with the same name exists.
10-
- **What changed**: `SET $name = 'value'` would previously overwrite the POST parameter `:name`. Now it creates an independent SET variable that shadows the POST parameter.
11-
- **Fix**: Either rename your SET variable, or use `:name` to access the original POST value if needed.
12-
- **Example**: If your form has a field named `name`, and you do `SET $name = 'modified'`, then `$name` will be 'modified' but `:name` will still contain the form value.
9+
- **BREAKING**: `SET $name` no longer overwrites GET (URL) parameters when a URL parameter with the same name exists.
10+
- **What changed**: `SET $name = 'value'` would previously overwrite the URL parameter `$name`. Now it creates an independent SET variable that shadows the URL parameter.
11+
- **Fix**: This is generally the desired behavior. If you need to access the original URL parameter after setting a variable with the same name, use `sqlpage.variables('get')` to access it.
12+
- **Example**: If your URL is `page.sql?name=john`, and you do `SET $name = 'modified'`, then `$name` will be 'modified'. The original URL parameter is still accessible via `sqlpage.variables('get')` but not via `$name` anymore.
1313
- **New behavior**: Variable lookup now follows this precedence:
1414
- `$variable` checks SET variables first, then URL parameters
1515
- `:variable` checks SET variables first, then POST parameters

0 commit comments

Comments
 (0)