Question

phpThumb is a PHP library that converts large images to image thumbnails and caches the result. It takes such a syntax: http://domain.com/phpThumb.php?src=/images/image.jpg

However in my web application I'm following a strict MVC architecture, so I changed the syntax to this: http://domain.com/thumb/images%2Fimage.jpg/width/height

However now the output image is now complaining

Usage: /workspace/urs/index.php?src=/path/and/filename.jpg

Even though I've checked the $_GET dump and it reads:

array(1) {
  ["src"]=>
  string(42) "/workspace/urs/images/portfolio/shoopm.jpg"
}

This is the code that runs up to the error (in my web application):

// If getting a thumbnail
if($qa[0] == "thumb")
{
    if(!isset($qa[1]) || !isset($qa[2]) || !isset($qa[3]))
        die("Bad thumb request. Needs 3 parameters!");

    unset($_GET["q"]);
    $_GET["src"] = $qa[1];
    $_GET["w"] = $qa[2];
    $_GET["h"] = $qa[3];

    include("phpThumb/phpThumb.php");

    exit();
}

Now, what I'm fearing is that phpThumb checks the actual URL, and not just the $_GET parameters... It's hard to confirm since the source contains thousands and thousands of lines of code and I haven't a clue where to start.

Thanks for any helpful replies

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top