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

Normalize destination URI before saving file #24

Merged
merged 1 commit into from
Jul 13, 2016
Merged

Normalize destination URI before saving file #24

merged 1 commit into from
Jul 13, 2016

Conversation

NoDiskInDriveA
Copy link
Contributor

Concatenating $destination_uri and a DIRECTORY_SEPARATOR can lead to situations where the file URI has too many slashes in the scheme part, e.g. "public:///". This is then saved into the file entity, ultimately ending up in the file_managed table.

This is usually not a problem as Drupal understands this kind of URI and also normalizes this to two slashes on a number of occasions. However, versions of the focal_point module that do not use the Crop API yet will try to compare a loaded file's URI with the string saved into the file_managed table (in FocalPoint::getFromURI()) and subsequently fails to load the correct data.

This patch just puts the final destination URI through the appropriate Drupal function that cleans it up.

@chrfritsch chrfritsch merged commit e5665f7 into BurdaMagazinOrg:8.x-1.x Jul 13, 2016
chrfritsch added a commit that referenced this pull request Jul 15, 2016
…ration into 8.x-1.x

* '8.x-1.x' of github.com:BurdaMagazinOrg/module-dcx-integration:
  Normalize destination URI before saving file (#24)
  Fix project composer name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants