Skip to content

Commit

Permalink
Merge pull request #112 from cloudinary/v.1.18.0
Browse files Browse the repository at this point in the history
V.1.18.0
  • Loading branch information
RonenGirit committed May 12, 2022
2 parents 5001a8a + 2417f90 commit 6a87b14
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 13 deletions.
15 changes: 13 additions & 2 deletions Model/Config/Backend/Credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class Credentials extends Encrypted
* @var ScopeConfigInterface
*/
protected $appConfig;

/**
* @var EncryptorInterface
*/
private $encryptor;

/**
* @param Context $context
Expand Down Expand Up @@ -79,7 +84,8 @@ public function __construct(
$this->configurationBuilder = $configurationBuilder;
$this->api = $api;
$this->appConfig = $appConfig;

$this->encryptor = $encryptor;

parent::__construct(
$context,
$registry,
Expand Down Expand Up @@ -107,7 +113,12 @@ public function beforeSave()
}

if ($this->isSaveAllowed()) {
$this->validate($this->getCredentialsFromEnvironmentVariable($rawValue));
if (stripos($rawValue, 'cloudinary://') !== false) {
$this->validate($this->getCredentialsFromEnvironmentVariable($rawValue));
} else {
$this->validate($this->getCredentialsFromEnvironmentVariable($this->encryptor->decrypt($rawValue)));
}

} else {
$this->validate($this->getCredentialsFromConfig());
}
Expand Down
6 changes: 4 additions & 2 deletions Model/Framework/File/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ public static function getCorrectFileName($fileName)
{
$fileName = preg_replace('/[^a-z0-9_\\-\\.]+/i', '_', $fileName);
$fileInfo = pathinfo($fileName);
$fileInfo['extension'] = (isset($fileInfo['extension']) && $fileInfo['extension']) ? $fileInfo['extension'] : '';

$index = 1;
while (file_exists($fileInfo['dirname'] . '/' . $fileInfo['basename'])) {
$fileInfo['basename'] = $fileInfo['filename'] . '_' . $index++ . '.' . $fileInfo['extension'];
}
// account for excessively long filenames that cannot be stored completely in database
if (strlen($fileInfo['basename']) > 180) {
throw new \InvalidArgumentException('Filename is too long; must be 180 characters or less');
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cloudinary/cloudinary-magento2",
"description": "Cloudinary Magento 2 Integration.",
"type": "magento2-module",
"version": "1.17.0",
"version": "1.18.0",
"license": "MIT",
"require": {
"cloudinary/cloudinary_php": "^1.20.0"
Expand All @@ -19,4 +19,4 @@
"type": "git",
"url": "https://github.com/cloudinary/cloudinary_magento2"
}]
}
}
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Cloudinary_Cloudinary" setup_version="1.17.0">
<module name="Cloudinary_Cloudinary" setup_version="1.18.0">
<sequence>
<module name="Magento_ProductVideo"/>
<module name="Magento_PageBuilder"/>
Expand Down
4 changes: 2 additions & 2 deletions marketplace.composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cloudinary/cloudinary",
"description": "Cloudinary Magento 2 Integration.",
"type": "magento2-module",
"version": "1.17.0",
"version": "1.18.0",
"license": "MIT",
"require": {
"cloudinary/cloudinary_php": "^1.20.0"
Expand All @@ -15,4 +15,4 @@
"Cloudinary\\Cloudinary\\": ""
}
}
}
}
2 changes: 1 addition & 1 deletion view/frontend/web/js/fotorama-add-video-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ define(
scriptTag = document.getElementsByTagName('script')[0];

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

/**
* Vimeo js framework on load callback.
Expand Down
9 changes: 6 additions & 3 deletions view/frontend/web/js/load-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
*/

/**
@version 0.0.1
@version 0.0.2
@requires jQuery & jQuery UI
*/

define(
['jquery', 'jquery/ui'],
[
'jquery',
'jquery-ui-modules/widget'
],
function ($) {
'use strict';

Expand Down Expand Up @@ -446,4 +449,4 @@ define(
}
);
}
);
);

0 comments on commit 6a87b14

Please sign in to comment.