File tree 3 files changed +18
-10
lines changed
3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,10 @@ public function collectData()
156
156
. $ element ['mainImage ' ]['url ' ]
157
157
. '" /></a> ' ;
158
158
159
+ $ item ['itunes ' ] = [
160
+ 'duration ' => $ durationSeconds ,
161
+ ];
162
+
159
163
$ this ->items [] = $ item ;
160
164
}
161
165
}
Original file line number Diff line number Diff line change @@ -147,11 +147,13 @@ public function stringify()
147
147
$ entry ->appendChild ($ itunesProperty );
148
148
$ itunesProperty ->appendChild ($ document ->createTextNode ($ itunesValue ));
149
149
}
150
- $ itunesEnclosure = $ document ->createElement ('enclosure ' );
151
- $ entry ->appendChild ($ itunesEnclosure );
152
- $ itunesEnclosure ->setAttribute ('url ' , $ itemArray ['enclosure ' ]['url ' ]);
153
- $ itunesEnclosure ->setAttribute ('length ' , $ itemArray ['enclosure ' ]['length ' ]);
154
- $ itunesEnclosure ->setAttribute ('type ' , $ itemArray ['enclosure ' ]['type ' ]);
150
+ if (isset ($ itemArray ['enclosure ' ])) {
151
+ $ itunesEnclosure = $ document ->createElement ('enclosure ' );
152
+ $ entry ->appendChild ($ itunesEnclosure );
153
+ $ itunesEnclosure ->setAttribute ('url ' , $ itemArray ['enclosure ' ]['url ' ]);
154
+ $ itunesEnclosure ->setAttribute ('length ' , $ itemArray ['enclosure ' ]['length ' ]);
155
+ $ itunesEnclosure ->setAttribute ('type ' , $ itemArray ['enclosure ' ]['type ' ]);
156
+ }
155
157
} elseif (!empty ($ entryUri )) {
156
158
$ entryLinkAlternate = $ document ->createElement ('link ' );
157
159
$ entry ->appendChild ($ entryLinkAlternate );
Original file line number Diff line number Diff line change @@ -135,11 +135,13 @@ public function stringify()
135
135
$ entry ->appendChild ($ itunesProperty );
136
136
$ itunesProperty ->appendChild ($ document ->createTextNode ($ itunesValue ));
137
137
}
138
- $ itunesEnclosure = $ document ->createElement ('enclosure ' );
139
- $ entry ->appendChild ($ itunesEnclosure );
140
- $ itunesEnclosure ->setAttribute ('url ' , $ itemArray ['enclosure ' ]['url ' ]);
141
- $ itunesEnclosure ->setAttribute ('length ' , $ itemArray ['enclosure ' ]['length ' ]);
142
- $ itunesEnclosure ->setAttribute ('type ' , $ itemArray ['enclosure ' ]['type ' ]);
138
+ if (isset ($ itemArray ['enclosure ' ])) {
139
+ $ itunesEnclosure = $ document ->createElement ('enclosure ' );
140
+ $ entry ->appendChild ($ itunesEnclosure );
141
+ $ itunesEnclosure ->setAttribute ('url ' , $ itemArray ['enclosure ' ]['url ' ]);
142
+ $ itunesEnclosure ->setAttribute ('length ' , $ itemArray ['enclosure ' ]['length ' ]);
143
+ $ itunesEnclosure ->setAttribute ('type ' , $ itemArray ['enclosure ' ]['type ' ]);
144
+ }
143
145
} if (!empty ($ itemUri )) {
144
146
$ entryLink = $ document ->createElement ('link ' );
145
147
$ entry ->appendChild ($ entryLink );
You can’t perform that action at this time.
0 commit comments