Commit 3004e93
authored
Only trim the leading slash from the DSN if a host is also available (#6790)
| Q | A
|------------- | -----------
| Type | improvement
| Fixed issues | #6789
#### Summary
Previously the DsnParser unconditionally removed the first character
from the path, without verifying that it is actually a slash and that it
is dealing with a reasonably well-formed URI. This causes confusing
behavior when a malformed URI that survives `parse_url()` is passed to
`parse()`, since DsnParser would return the input as the `dbname`, but
with the first character missing.
This can lead to hard-to-debug situations when the DSN is coming from an
environment variable, where quoting characters are accidentally included
in the value itself, instead of being interpreted by the tool setting
the env, since the `dbname` almost looks like the intended input (but
still having the trailing quote).
see #67891 parent a11db88 commit 3004e93
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| 138 | + | |
| 139 | + | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
0 commit comments