File tree Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,9 @@ public function getCName()
8484 */
8585 public function buildUrl ($ inputUrl )
8686 {
87+ $ baseUrl = "// " . $ this ->getToken () . ".cloudimg.io/ " ;
8788 if (!empty ($ this ->getCName ())) {
88- $ baseUrl = "// " . $ this ->getCName () . "/ " ;
89- } else {
90- $ baseUrl = "// " . $ this ->getToken () . ".cloudimg.io/ " ;
89+ $ inputUrl = str_replace ($ this ->getCName (), "" , $ inputUrl );
9190 }
9291
9392 if (!$ this ->isRemoveV7 ()) {
Original file line number Diff line number Diff line change @@ -107,16 +107,9 @@ public function processHtml($html)
107107
108108 $ imageSrc = $ element ->getAttribute ('src ' ) . $ quality ;
109109
110- if (!empty ($ this ->config ->getCName ())) {
111- if (stripos ($ imageSrc , $ this ->config ->getCName ()) === false ) {
112- $ ciSrc = $ this ->config ->buildUrl ($ imageSrc );
113- $ element ->setAttribute ('src ' , $ ciSrc );
114- }
115- } else {
116- if (stripos ($ imageSrc , $ this ->config ->getToken ()) === false ) {
117- $ ciSrc = $ this ->config ->buildUrl ($ imageSrc );
118- $ element ->setAttribute ('src ' , $ ciSrc );
119- }
110+ if (stripos ($ imageSrc , $ this ->config ->getToken ()) === false ) {
111+ $ ciSrc = $ this ->config ->buildUrl ($ imageSrc );
112+ $ element ->setAttribute ('src ' , $ ciSrc );
120113 }
121114 } else {
122115 if ($ element ->hasAttribute ('data-lazy-off ' )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class ResponsiveBlock
2424 /**
2525 * @var Images
2626 */
27- private $ helper ;
27+ private $ images ;
2828
2929 public function __construct (
3030 Config $ config ,
You can’t perform that action at this time.
0 commit comments