Skip to content

Commit

Permalink
* Fixed an issue with template metas on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Welch committed Aug 2, 2017
1 parent 2f40898 commit 376eddf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Changed `referrer` from `always` to `no-referrer-when-downgrade`
* Fixed an issue where meta vars were not sanitized with a custom template passed via `seomaticTemplatePath`
* Fixed a cosmetic bug where the SEOmatic FieldType settings didn't display the OpenGraph Image Source Changeable properly
* Fixed an issue with template metas on Windows

## 1.1.48 - 2017.06.18
### Changed
Expand Down
3 changes: 2 additions & 1 deletion releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"[Improved] Changed `referrer` from `always` to `no-referrer-when-downgrade`",
"[Fixed] Fix issue when passing a string containing the `à` character to _cleanupText()",
"[Fixed] Fixed an issue where meta vars were not sanitized with a custom template passed via `seomaticTemplatePath`",
"[Fixed] Fixed a cosmetic bug where the SEOmatic FieldType settings didn't display the 'OpenGraph Image Source Changeable' properly"
"[Fixed] Fixed a cosmetic bug where the SEOmatic FieldType settings didn't display the 'OpenGraph Image Source Changeable' properly",
"[Fixed] Fixed an issue with template metas on Windows"
]
},
{
Expand Down
4 changes: 4 additions & 0 deletions twigextensions/SeomaticTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ private function _get_current_template_path()
$currentTemplate = craft()->templates->getRenderingTemplate();
$templatesPath = method_exists(craft()->templates, 'getTemplatesPath') ? craft()->templates->getTemplatesPath() : craft()->path->getTemplatesPath();

// Try to normalize things for Windows
$currentTemplate = str_replace('\\', '/', $currentTemplate);
$templatesPath = str_replace('\\', '/', $templatesPath);

$path_parts = pathinfo($currentTemplate);

if ($path_parts && isset($path_parts['dirname']) && isset($path_parts['filename']))
Expand Down

0 comments on commit 376eddf

Please sign in to comment.