splittingred/phpThumbOf — Issue #27: str_replace('//','/',$cacheUrl); producing incorrect image url
Author: lucasmodx
Created: 2011-10-17 11:16:18+00:00
State: open

When developing in my local environment, phpthumbof was producing incorrect image urls:

http://localhost:8888/localhost:8888/path/to/image/

I traced the issue to the following code in the snippet file. Commenting out the str_replace line solved the issue for me.
Note I was executing phpthumbof using $modx->runSnippet

/* get cache Url */
$assetsUrl = $modx->getOption('phpthumbof.assets_url',$scriptProperties,$modx->getOption('assets_url').'components/phpthumbof/');
$cacheUrl = $assetsUrl.'cache/'.str_replace($cacheDir,'',$cacheKey);
//$cacheUrl = str_replace('//','/',$cacheUrl);