Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#985 Fix trailing slash for urls on Windows #14405

Merged
merged 1 commit into from
Jun 3, 2019

Conversation

seamuslee001
Copy link
Contributor

Overview

This fixes an issue where addTrailingSlash would generate a \ instead of a '/' on Windows for URLs which is in correct

Before

Wrong trailing slash added to urls

After

correct trailing slash added

ping @demeritcowboy @eileenmcnaughton

@civibot
Copy link

civibot bot commented Jun 2, 2019

(Standard links)

@civibot civibot bot added the 5.14 label Jun 2, 2019
@eileenmcnaughton
Copy link
Contributor

ah yes & code comment says

    if (!$slash) {
      // FIXME: Defaulting to backslash on windows systems can produce
      // unexpected results, esp for URL strings which should always use forward-slashes.
      // I think this fn should default to forward-slash instead.
      $slash = DIRECTORY_SEPARATOR;
    }

good to merge

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 why is this an rc issue though?

@seamuslee001
Copy link
Contributor Author

@eileenmcnaughton just figured sooner the fix is in the better and its such a small change

@demeritcowboy
Copy link
Contributor

Thanks. Although I didn't put up a PR initially because even though the patch is correct the url is used a lot of places, and I'd want to do something like check if there's already code like rtrim($url, DIRECTORY_SEPARATOR) that might now fail. And I think at least an install on windows from scratch would be appropriate. I'm willing to test it out, but maybe against master is better, depending on when you're planning 5.14.

@seamuslee001 seamuslee001 changed the base branch from 5.14 to master June 2, 2019 23:25
@civibot civibot bot added master and removed 5.14 labels Jun 2, 2019
@seamuslee001
Copy link
Contributor Author

switched it to master given @demeritcowboy 's concerns keep merge on pass

@eileenmcnaughton
Copy link
Contributor

Yeah - I think it didn't really 'qualify' for the rc

@eileenmcnaughton
Copy link
Contributor

test this please

@seamuslee001 seamuslee001 merged commit 1e2541f into civicrm:master Jun 3, 2019
@seamuslee001 seamuslee001 deleted the lab_core_985 branch June 3, 2019 03:08
@demeritcowboy
Copy link
Contributor

Just a followup note I've been running with it on my local with the userFrameworkResourceURL setting put back to portable and haven't noticed anything odd. Did a fresh install and looks ok. Also did a quick check for rtrim(..., DIRECTORY_SEPARATOR) and looks ok.

@eileenmcnaughton
Copy link
Contributor

OK - let's merge then - it feels safe & sensible to me too & it will hit the 5.15 rc if I merge now

@eileenmcnaughton
Copy link
Contributor

oh it IS merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants