syamilmj / Aqua-Resizer

Resize WordPress images on the fly
502 stars 208 forks source link

local url check does not work with wpml set to use a directory per language #4

Closed rico closed 11 years ago

rico commented 11 years ago

The local url check on line 35 does not work when WPML is set to use a different directory for the languages (e.g. http://www.smartcode.ch/de for german).

The current check, using home_url() fails, since this function does return http://www.smartcode.ch/de if on the german page.

I suggest to replace home_url() with $upload_url (defined on line 32), which is wp_upload_dir() -> baseurl on line 35 to check if the image url ($url) is local.

syamilmj commented 11 years ago

Thanks for that. Just pushed an update.

Cheers :)