<commit_before><?php

namespace Rudolf\Component\Images;

class Image
{
    public static function resize($url, $w, $h)
    {
        if (substr($url, 0, strlen(DIR)) === DIR) {
            $url = str_replace(DIR, '', $url);
        }
        if (substr($url, 0, strlen('/content/'))) {
            $url = str_replace('/content/', '', $url);
        }

        return CONTENT.'/cache/'.$w.'/'.$h.'/'.ltrim($url, '/');
    }
}
<commit_msg>Fix str_replace<commit_after><?php

namespace Rudolf\Component\Images;

class Image
{
    public static function resize($url, $w, $h)
    {
        if (substr($url, 0, strlen(DIR)) === DIR) {
            $url = str_replace(DIR, '', $url);
        }
        if (substr($url, 0, strlen('/content/')) === '/content/') {
            $url = str_replace('/content/', '', $url);
        }

        return CONTENT.'/cache/'.$w.'/'.$h.'/'.ltrim($url, '/');
    }
}

{'fraction_non_alphanumeric': 0.22706935123042504, 'fraction_numerical': 0.0044742729306487695, 'mean_word_length': 2.173758865248227, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5912542', 'n_tokens_mistral': 311, 'n_tokens_neox': 306, 'n_words': 58}