Skip to content

Commit d2a6961

Browse files
authored
Merge pull request #734 from cloudinary/fix/empty-public-ids
don't use empty public_id
2 parents e7b5cd6 + 5425a4f commit d2a6961

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

php/class-delivery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ public function convert_tags( $content, $context = 'view' ) {
887887
// Create aliases for urls where were found, but not found with an ID in a tag.
888888
// Create the Full/Scaled items first.
889889
foreach ( $this->known as $url => $relation ) {
890-
if ( $url === $relation['public_id'] ) {
890+
if ( empty( $relation['public_id'] || $url === $relation['public_id'] ) ) {
891891
continue; // We don't need the public_id relation item.
892892
}
893893
$base = $type . ':' . $url;
@@ -897,7 +897,7 @@ public function convert_tags( $content, $context = 'view' ) {
897897

898898
// Create the sized found relations second.
899899
foreach ( $this->found_urls as $url => $sizes ) {
900-
if ( ! isset( $this->known[ $url ] ) ) {
900+
if ( ! isset( $this->known[ $url ] ) || empty( $this->known[ $url ]['public_id'] ) ) {
901901
continue;
902902
}
903903
$base = $type . ':' . $url;

0 commit comments

Comments
 (0)