Closed robsonsobral closed 5 years ago
Seems like this one has been solved. No one else reported such a problem. Otherwise please reopen or create a new issue.
Hi, I have the similar issue when I call site.com/wp-admin/export.php?type=hugo:
Warning: Invalid argument supplied for foreach() in /home/site.com/wp-content/plugins/wordpress-to-hugo-exporter-master/hugo-export.php on line 371
PKL7J§≤b?2Ùhugo-export/about/index.mdUë¡N¬@E˜˝äŸ€ö°Ï˙.L\ì–® jå;@¡D6.˝ì“P©•¥øpflyflîÿΩôwÔ}gfiA‡%è… é>ëÀ)(ºfiSÚ0GÊ9x…ÀàÌQÔ>ˆ˙ΩÑeh;6ËÑAÿΩ √»v£∞{emd≠ÁÃ√7cjÉF¶(P1ujd&sSQ»RVôπé˚7„x2π6¯Bç6i;R’P5CJœ⁄`è3fZ8 j&UÏ.©˙0ÙPõcã\§?]•¯%HÓyW lul√‚ kÜ÷»tùŒ≤wÉY˙e˚ÄL ö∆c)؃H/P9£vt-®æÒî^∫Ó˘ìˇ—`wŸÛ5©<≥Ú:
Fixed line https://github.com/SchumacherFM/wordpress-to-hugo-exporter/blob/master/hugo-export.php#L371
foreach ( (array)glob(trailingslashit($dir) . '*') as $path) {
F*** PHP regarding glob:
On some systems it is impossible to distinguish between empty match and an error.
@weldpua2008 can you please send me a pull request with your fix?
I'm closing this as too old or maybe even fixed.
Hi!
The loop at line 370,
foreach (glob(trailingslashit($dir) . '*') as $path) {
is failing to run if there are empty directories onwp-content/uploads/
. I'm sorry, but I don't know how to fix it. I deleted all empty directories and filled the directory of current month with a dummy text file.Thanks, guys.