);
}
- function isProtected($url) {
- return 'http://www.facebook.com/login.php' === $url;
+ public static function isProtected($url) {
+
+ $protected_urls_exps = array(
+ 'https://www.facebook.com/login.php',
+ common_path('main/login')
+ );
+
+ foreach ($protected_urls_exps as $protected_url_exp) {
+ if (preg_match('!^'.preg_quote($protected_url_exp).'(.*)$!i', $url) === 1) {
+ return true;
+ }
+ }
+
+ return false;
}
/**
* @throws UnsupportedMediaException if, despite trying, we can't understand how to make a thumbnail for this format
* @throws ServerException on various other errors
*/
- public function getThumbnail($width=null, $height=null, $crop=false, $force_still=true)
+ public function getThumbnail($width=null, $height=null, $crop=false, $force_still=true, $upscale=null)
{
// Get some more information about this file through our ImageFile class
$image = ImageFile::fromFileObject($this);
}
}
- return $image->getFileThumbnail($width, $height, $crop);
+ // Debug log (convert crop to int to have TRUE being displayed as 1 and FALSE as 0)
+ /* NOISY-DEBUG: */ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: width=' . $width . ',height=' . $height . ',crop=' . intval($crop) . ',upscale=' . intval($upscale));
+
+ return $image->getFileThumbnail($width, $height, $crop,
+ !is_null($upscale) ? $upscale : common_config('thumbnail', 'upscale'));
}
public function getPath()
echo "DONE.\n";
echo "Resuming core schema upgrade...";
}
-}
\ No newline at end of file
+}