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) {
416
416
* Return the url path
417
417
*/
418
418
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 ' ]).'/ ' : '/ ' ;
420
420
421
421
if ($ file && !empty ($ this ->info ['file ' ])) {
422
422
$ path .= $ this ->info ['file ' ];
Original file line number Diff line number Diff line change @@ -81,4 +81,19 @@ public function testUrls () {
81
81
)
82
82
);
83
83
}
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