summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Auditor2011-11-22 17:05:34 (GMT)
committer Stefan Auditor2011-11-22 17:05:34 (GMT)
commitaecbbde5b310b14fc6871cf359f2c79cfaf84afd (patch)
tree526499b921cd8a81cbb52362a0c0b08d09485af9
parent1656ebcc79b21ebd5afa253716e67155a8ae572b (diff)
Issue # by Matt Wilcox: Fixed user agent detection and mobile_first is set to true per default now.7.x-1.2
-rw-r--r--adaptive_image.image.inc6
-rw-r--r--adaptive_image.module2
2 files changed, 4 insertions, 4 deletions
diff --git a/adaptive_image.image.inc b/adaptive_image.image.inc
index 8173d7e..bdafcdc 100644
--- a/adaptive_image.image.inc
+++ b/adaptive_image.image.inc
@@ -114,9 +114,9 @@ function adaptive_image_browser_detect() {
$userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
// Identify the OS platform. Match only desktop OSs
- if (preg_match('/Macintosh/', $userAgent) ||
- preg_match('/Windows NT/', $userAgent) ||
- preg_match('/X11/', $userAgent)) {
+ if (strpos($userAgent,'macintosh') ||
+ strpos($userAgent,'windows nt') ||
+ strpos($userAgent,'x11')
return TRUE;
}
}
diff --git a/adaptive_image.module b/adaptive_image.module
index 06c4171..e053e21 100644
--- a/adaptive_image.module
+++ b/adaptive_image.module
@@ -98,7 +98,7 @@ function adaptive_image_scale_form($data) {
$form['mobile_first'] = array(
'#type' => 'checkbox',
'#title' => t('Mobile first'),
- '#default_value' => isset($data['mobile_first']) ? $data['mobile_first'] : FALSE,
+ '#default_value' => isset($data['mobile_first']) ? $data['mobile_first'] : TRUE,
'#description' => t("Check this to send the smallest version when the resolution can not be determined."),
);
// Provide needed defaults