From de49bbff8de3d7aa797f1a6d07ad8473b2288256 Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Mon, 11 Mar 2019 18:22:00 +0300 Subject: [PATCH] Fix assets urls on non *nix systems --- Plugin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugin.php b/Plugin.php index 168569a..496f7b4 100644 --- a/Plugin.php +++ b/Plugin.php @@ -86,7 +86,7 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi public function attachJSFiles(&$args) { if ($this->isAppropriatePage($args['request'])) { - $base_path = $this->getFilesPath(); + $base_path = str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath()); $args['js'][] = $base_path . '/vendor/es5-shim/es5-shim.js'; $args['js'][] = $base_path . '/vendor/emojify.js/emojify.js'; $args['js'][] = $base_path . '/js/plugin.js'; @@ -101,7 +101,7 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi public function attachCssFiles(&$args) { if ($this->isAppropriatePage($args['request'])) { - $args['css'][] = $this->getFilesPath() . '/css/styles.css'; + $args['css'][] = str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath()) . '/css/styles.css'; } } @@ -116,7 +116,8 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi if ($this->isAppropriatePage($request)) { $args['plugins']['MibewEmoji'] = array( - 'imagesDir' => ($request->getBasePath() . '/' . $this->getFilesPath() + 'imagesDir' => ($request->getBasePath() . '/' + . str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath()) . '/vendor/emojify.js/images/emoji'), 'ignoreEmoticons' => $this->config['ignore_emoticons'], );