Skip to content

Commit 33dad46

Browse files
committed
ACF compatibility to fix invalid backreference error
1 parent 42f7f58 commit 33dad46

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/lib/cloudinary.cfc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,16 @@ component {
164164
}
165165

166166
public struct function getURLInformation(required string file) {
167+
167168
var apiDomain = getAPIDomain();
168169
var cloudName = getCloudName();
169170
var uploadVia = application.fapi.getConfig("cloudinary", "uploadVia", "post");
170171
var autoUploadFolder = application.fapi.getConfig("cloudinary", "autoUploadFolder", "/nothing___here");
171-
172+
172173
var apiURLPrefix = "//" & apiDomain & "/" & cloudName & "/image";
173-
174+
174175
var reAPI = "^//" & replace(apiDomain, '.', '\.', 'ALL') & "/" & replace(cloudName, '.', '\.', 'ALL') & "/image";
175-
var reCDN = rereplace(rereplace(application.fc.lib.cdn.ioGetFileLocation(location="images", file="", bRetrieve=true, protocol="http").path, "([\.\?\+])", "\\1", "all"), "http:", "^(https?:)?");
176+
var reCDN = reReplace(replaceList(application.fc.lib.cdn.ioGetFileLocation(location="images", file="", bRetrieve=true, protocol="http").path, ".,?,+", "\.,\?,\+"), "http:", "^(https?:)?");
176177
var reFetch = reAPI & "/fetch(?:/([^/]+))?/(http.*)$";
177178
var reAuto = reAPI & "/upload(?:/([^/]+))?" & autoUploadFolder & "(/.*)$";
178179
var rePost = reAPI & "/upload(?:/([^/]+))?(/[^/\?]+)(\?.*|$)";

0 commit comments

Comments
 (0)