You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if baseUri =="/"&& strlen(strUri) ==1&& strUri[0] =='/' {
let uri = baseUri;
} else {
let uri = baseUri . strUri;
}
}
with
let uri = \Phalcon\Helper\Str::reduceSlashes(baseUri . strUri);
furthermore, we can reduce the overhead of invoking an extra function and directly use
let uri = preg_replace("#(?<!:)//+#", "/", baseUri . strUri);
The only scenario in which this wouldn't work is if we passed an url with relative protocols like //netdna.bootstrapcdn.com/twitter-bootstrap/2.3.4/css/bootstrap-combined.min.css but in that case, that wouldn't be a local URL, therefore it does not pose a problem.
The implementation of this method in
v3.4
may return links like:https://www.example.com//images/booya.jpg
I see that this has been reported and fixed for
v4
in #13495However, why don't we utilize our own helper and replace these 8 lines
cphalcon/phalcon/Url.zep
Lines 166 to 174 in e78ab44
with
furthermore, we can reduce the overhead of invoking an extra function and directly use
The only scenario in which this wouldn't work is if we passed an url with relative protocols like
//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.4/css/bootstrap-combined.min.css
but in that case, that wouldn't be a local URL, therefore it does not pose a problem.cc @niden @sergeyklay @Jurigag
The text was updated successfully, but these errors were encountered: