summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2ee336e)
Support other paths while retaining compatibility with /data-implied links.
-list ($height, $imgarg) = explode('/', ltrim($Args, '/'), 2);
+list ($height, $imgpath) = explode('/', ltrim($Args, '/'), 2);
-$imgpath = "data/$imgarg";
+$imgpath = preg_replace('{^(?=[0-9]+/)}', 'data/', $imgpath, 1);
if (!file_exists($imgpath)) {
http_response_code(404);
exit;
}
if (!file_exists($imgpath)) {
http_response_code(404);
exit;
}
-$target = preg_replace("{^data/}", "thumb/$height/", $imgpath, 1);
+$target = "thumb/$height/$imgpath";
if (!file_exists($target)) {
@mkdir(dirname($target), 0777, TRUE);
if (!file_exists($target)) {
@mkdir(dirname($target), 0777, TRUE);