File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ public function setPath ($path) {
416416 * Return the url path
417417 */
418418 public function getPath ($ file = false ) {
419- $ path = isset ($ this ->info ['path ' ]) ? '/ ' .implode ('/ ' , $ this ->info ['path ' ]).'/ ' : '/ ' ;
419+ $ path = isset ($ this ->info ['path ' ]) && ! empty ( $ this -> info [ ' path ' ]) ? '/ ' .implode ('/ ' , $ this ->info ['path ' ]).'/ ' : '/ ' ;
420420
421421 if ($ file && !empty ($ this ->info ['file ' ])) {
422422 $ path .= $ this ->info ['file ' ];
Original file line number Diff line number Diff line change @@ -81,4 +81,19 @@ public function testUrls () {
8181 )
8282 );
8383 }
84- }
84+
85+ public function testUrlParser ()
86+ {
87+ $ urls = array (
88+ 'http://vimeo.com//69912181? ' => 'http://vimeo.com/69912181 ' ,
89+ 'http://vimeo.com//69912181 ' => 'http://vimeo.com/69912181 ' ,
90+ 'http://vimeo.com/69912181 ' => 'http://vimeo.com/69912181 ' ,
91+ );
92+
93+ foreach ($ urls as $ url => $ expected_url ) {
94+ $ parsed_url = new Embed \Url ($ url );
95+
96+ $ this ->assertEquals ($ expected_url , $ parsed_url ->getUrl ());
97+ }
98+ }
99+ }
You can’t perform that action at this time.
0 commit comments