Skip to content

Commit 6a87b14

Browse files
authored
Merge pull request #112 from cloudinary/v.1.18.0
V.1.18.0
2 parents 5001a8a + 2417f90 commit 6a87b14

File tree

7 files changed

+29
-13
lines changed

7 files changed

+29
-13
lines changed

Model/Config/Backend/Credentials.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ class Credentials extends Encrypted
4646
* @var ScopeConfigInterface
4747
*/
4848
protected $appConfig;
49+
50+
/**
51+
* @var EncryptorInterface
52+
*/
53+
private $encryptor;
4954

5055
/**
5156
* @param Context $context
@@ -79,7 +84,8 @@ public function __construct(
7984
$this->configurationBuilder = $configurationBuilder;
8085
$this->api = $api;
8186
$this->appConfig = $appConfig;
82-
87+
$this->encryptor = $encryptor;
88+
8389
parent::__construct(
8490
$context,
8591
$registry,
@@ -107,7 +113,12 @@ public function beforeSave()
107113
}
108114

109115
if ($this->isSaveAllowed()) {
110-
$this->validate($this->getCredentialsFromEnvironmentVariable($rawValue));
116+
if (stripos($rawValue, 'cloudinary://') !== false) {
117+
$this->validate($this->getCredentialsFromEnvironmentVariable($rawValue));
118+
} else {
119+
$this->validate($this->getCredentialsFromEnvironmentVariable($this->encryptor->decrypt($rawValue)));
120+
}
121+
111122
} else {
112123
$this->validate($this->getCredentialsFromConfig());
113124
}

Model/Framework/File/Uploader.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public static function getCorrectFileName($fileName)
2929
{
3030
$fileName = preg_replace('/[^a-z0-9_\\-\\.]+/i', '_', $fileName);
3131
$fileInfo = pathinfo($fileName);
32-
$fileInfo['extension'] = (isset($fileInfo['extension']) && $fileInfo['extension']) ? $fileInfo['extension'] : '';
33-
32+
$index = 1;
33+
while (file_exists($fileInfo['dirname'] . '/' . $fileInfo['basename'])) {
34+
$fileInfo['basename'] = $fileInfo['filename'] . '_' . $index++ . '.' . $fileInfo['extension'];
35+
}
3436
// account for excessively long filenames that cannot be stored completely in database
3537
if (strlen($fileInfo['basename']) > 180) {
3638
throw new \InvalidArgumentException('Filename is too long; must be 180 characters or less');

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cloudinary/cloudinary-magento2",
33
"description": "Cloudinary Magento 2 Integration.",
44
"type": "magento2-module",
5-
"version": "1.17.0",
5+
"version": "1.18.0",
66
"license": "MIT",
77
"require": {
88
"cloudinary/cloudinary_php": "^1.20.0"
@@ -19,4 +19,4 @@
1919
"type": "git",
2020
"url": "https://github.com/cloudinary/cloudinary_magento2"
2121
}]
22-
}
22+
}

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Cloudinary_Cloudinary" setup_version="1.17.0">
3+
<module name="Cloudinary_Cloudinary" setup_version="1.18.0">
44
<sequence>
55
<module name="Magento_ProductVideo"/>
66
<module name="Magento_PageBuilder"/>

marketplace.composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cloudinary/cloudinary",
33
"description": "Cloudinary Magento 2 Integration.",
44
"type": "magento2-module",
5-
"version": "1.17.0",
5+
"version": "1.18.0",
66
"license": "MIT",
77
"require": {
88
"cloudinary/cloudinary_php": "^1.20.0"
@@ -15,4 +15,4 @@
1515
"Cloudinary\\Cloudinary\\": ""
1616
}
1717
}
18-
}
18+
}

view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ define(
503503
scriptTag = document.getElementsByTagName('script')[0];
504504

505505
element.async = true;
506-
element.src = 'https://secure-a.vimeocdn.com/js/froogaloop2.min.js';
506+
element.src = 'https://f.vimeocdn.com/js/froogaloop2.min.js';
507507

508508
/**
509509
* Vimeo js framework on load callback.

view/frontend/web/js/load-player.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
*/
55

66
/**
7-
@version 0.0.1
7+
@version 0.0.2
88
@requires jQuery & jQuery UI
99
*/
1010

1111
define(
12-
['jquery', 'jquery/ui'],
12+
[
13+
'jquery',
14+
'jquery-ui-modules/widget'
15+
],
1316
function ($) {
1417
'use strict';
1518

@@ -446,4 +449,4 @@ define(
446449
}
447450
);
448451
}
449-
);
452+
);

0 commit comments

Comments
 (0)