GCX / acf-address-field

Advanced Custom Fields - Address Field add-on
BSD 3-Clause "New" or "Revised" License
13 stars 13 forks source link

URLs are broken on Windows hosts #4

Closed Omicron7 closed 12 years ago

Omicron7 commented 12 years ago

Original issue was described in #2:

from @michapixel

I'm on wp 3.3.2 and use ACF Version 3.1.7 and i get errors like: "NetworkError: 403 Forbidden - http://localhost/wordpress_test/D:wampwwwwordpress_testwp-contentpluginsacf-address-field/address-field.css?ver=3.3.2"

Omicron7 commented 12 years ago

I'm installing a windows VM with wordpress to try to get this figured out. Information that would help solve this would be:

michapixel commented 12 years ago

wp: 3.3.2 php: 5.3.9 ABSPATH: "D:\wamp\www\wordpress_test/" base_dir: "D:\wamp\www\wordpress_test\wp-content\plugins\advanced-custom-fields-address-field-add-on" base_uri_rel: "/D:/wamp/www/wordpress_test/wp-content/plugins/advanced-custom-fields-address-field-add-on" FILE: "D:\wamp\www\wordpress_test\wp-content\plugins\advanced-custom-fields-address-field-add-on\address-field.php"

Omicron7 commented 12 years ago

Ahh, I see the issue. WordPress is adding a trailing slash to the ABSPATH that I'm not stripping off when doing string comparisons. Changing line 99 from $root = array_pop( explode( DIRECTORY_SEPARATOR, rtrim( ABSPATH, DIRECTORY_SEPARATOR ) ) ); to $root = array_pop( explode( DIRECTORY_SEPARATOR, rtrim( ABSPATH, '/' ) ) ); fixed it for my Windows VM.

michapixel commented 12 years ago

let me try it quickly ....

michapixel commented 12 years ago

yup much better now.

Omicron7 commented 12 years ago

ok, I'll get that merged into the development branch, it might be a bit before I can get a new version pushed to the WordPress plugin repo.