Fossil SCM

Guess that agents with "iPad" in their name do not want the narrow screen versions of the page.

drh 2018-09-27 02:17 trunk
Commit b76eebea8793b3b2fd9f507485674122c3ff5a49f7d0915f367f47932af23764
1 file changed +1
+1
--- src/cgi.c
+++ src/cgi.c
@@ -2077,7 +2077,8 @@
20772077
** The returned value is a guess. Use it only for setting up defaults.
20782078
*/
20792079
int cgi_from_mobile(void){
20802080
const char *zAgent = P("HTTP_USER_AGENT");
20812081
if( zAgent==0 ) return 0;
2082
+ if( sqlite3_strglob("*iPad*", zAgent)==0 ) return 0;
20822083
return sqlite3_strlike("%mobile%", zAgent, 0)==0;
20832084
}
20842085
--- src/cgi.c
+++ src/cgi.c
@@ -2077,7 +2077,8 @@
2077 ** The returned value is a guess. Use it only for setting up defaults.
2078 */
2079 int cgi_from_mobile(void){
2080 const char *zAgent = P("HTTP_USER_AGENT");
2081 if( zAgent==0 ) return 0;
 
2082 return sqlite3_strlike("%mobile%", zAgent, 0)==0;
2083 }
2084
--- src/cgi.c
+++ src/cgi.c
@@ -2077,7 +2077,8 @@
2077 ** The returned value is a guess. Use it only for setting up defaults.
2078 */
2079 int cgi_from_mobile(void){
2080 const char *zAgent = P("HTTP_USER_AGENT");
2081 if( zAgent==0 ) return 0;
2082 if( sqlite3_strglob("*iPad*", zAgent)==0 ) return 0;
2083 return sqlite3_strlike("%mobile%", zAgent, 0)==0;
2084 }
2085

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button