File tree Expand file tree Collapse file tree 7 files changed +29
-13
lines changed Expand file tree Collapse file tree 7 files changed +29
-13
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ' );
Original file line number Diff line number Diff line change 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"
1919 "type" : " git" ,
2020 "url" : " https://github.com/cloudinary/cloudinary_magento2"
2121 }]
22- }
22+ }
Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 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"
1515 "Cloudinary\\ Cloudinary\\ " : " "
1616 }
1717 }
18- }
18+ }
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff line change 44 */
55
66/**
7- @version 0.0.1
7+ @version 0.0.2
88 @requires jQuery & jQuery UI
99 */
1010
1111define (
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+ ) ;
You can’t perform that action at this time.
0 commit comments