root/ip/tags/release_1_3_0_53/posted_img_thumbnail.php
| 111 | 163 | ||
|---|---|---|---|
186 | $server_path = create_server_url(); | 186 | $server_path = create_server_url(); |
187 | $pic_exists = false; | 187 | $pic_exists = false; |
188 | $pic_local = false; | 188 | $pic_local = false; |
189 | $pic_localpath = ''; | 189 | if ((strpos($pic_fullpath, $server_path) !== false) || @file_exists($pic_fullpath)) |
190 | if (strpos($pic_fullpath, $server_path) !== false) | ||
191 | { | 190 | { |
192 | $pic_local = true; | 191 | $pic_local = true; |
193 | $pic_localpath = str_replace($server_path, '', $pic_fullpath); | 192 | $pic_localpath = str_replace($server_path, '', $pic_fullpath); |
194 | // Mighty Gorgon - Are we sure that this won't cause other issues??? Test please... | 193 | if(@file_exists($pic_localpath)) |
195 | $pic_fullpath = $pic_localpath; | ||
196 | if(file_exists($pic_fullpath)) | ||
197 | { | 194 | { |
195 | // Mighty Gorgon - Are we sure that this won't cause other issues??? Test please... | ||
196 | $pic_fullpath = $pic_localpath; | ||
198 | $pic_exists = true; | 197 | $pic_exists = true; |
199 | } | 198 | } |
200 | } | 199 | else |
201 | else | ||
202 | { | ||
203 | if(any_url_exists($pic_fullpath)) | ||
204 | { | 200 | { |
205 | $pic_exists = true; | 201 | if (@file_exists(array_shift(explode('?', basename($pic_localpath))))) |
202 | { | ||
203 | $pic_exists = true; | ||
204 | } | ||
206 | } | 205 | } |
207 | } | 206 | } |
208 | if($pic_exists == false) | 207 | |
208 | if(!$pic_exists && any_url_exists($pic_fullpath)) | ||
209 | { | 209 | { |
210 | $pic_exists = true; | ||
211 | } | ||
212 | |||
213 | if(!$pic_exists) | ||
214 | { | ||
210 | header('Content-type: image/jpeg'); | 215 | header('Content-type: image/jpeg'); |
211 | header('Content-Disposition: filename=thumb_' . $pic_title_reg . '.' . $pic_filetype); | 216 | header('Content-Disposition: filename=thumb_' . $pic_title_reg . '.' . $pic_filetype); |
212 | readfile($images['no_thumbnail']); | 217 | readfile($images['no_thumbnail']); |
... | ... | ||
217 | 222 | ||
218 | if ($image_processed == false) | 223 | if ($image_processed == false) |
219 | { | 224 | { |
220 | if ($pic_local == true) | 225 | $pic_size = get_full_image_info($pic_fullpath, null, $pic_local); |
221 | { | ||
222 | $pic_size = get_full_image_info($pic_fullpath, null, true); | ||
223 | } | ||
224 | else | ||
225 | { | ||
226 | $pic_size = get_full_image_info($pic_fullpath); | ||
227 | } | ||
228 | 226 | ||
229 | if($pic_size == false) | 227 | if($pic_size == false) |
230 | { | 228 | { |
Download diff