loringllc
Forum Replies Created
-
Forum: Plugins
In reply to: [Dropbox Photo Sideloader] error when sideloadingSeems the issue is really a WP core problem with media_sideload_image(). preg_replace() between “\” and “.” from right to left. before calling media_sideload_image(). That would have been my next thought. But then I could have my head in a dark place. 🙂
Forum: Plugins
In reply to: [Dropbox Photo Sideloader] error when sideloadingoops ! forgot one little wrinkle – if you don’t change this line your file will have the %20 where the spaces where in file name saved on the server. so do this –
replace:
$file_array[‘name’] = basename($matches[0]);with:
$file_array[‘name’] = preg_replace(‘/\s|%20/’, ‘-‘, basename($matches[0]));
in file
wp-admin/includes/media.php
ok its a core file but it works your file gets uploaded and gets saved as something you can use.You would think sideload function would sanitize the file names – oh well!
Forum: Plugins
In reply to: [Dropbox Photo Sideloader] error when sideloadingTry this it works just fine, around line 214 in file dropbox-photo-sideloader.php in wp-content/plugins/dropbox-photo-sideloader
replace:
$result = media_sideload_image(urldecode($tempurl[‘url’]), $post_id);
with:
$result = media_sideload_image(urldecode(rawurlencode($tempurl['url'])), $post_id);I also added:
$file = rawurlencode($file); above: echo " <li>Sideloading {$file} ... "; just for an intelligent check works current wp version as of this post. Merry Christmas</li>