Plugin Directory

Changeset 1893383


Ignore:
Timestamp:
06/15/2018 09:26:18 AM (8 years ago)
Author:
morunas
Message:

Added browser check feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dot-embed/trunk/dot-embed.php

    r1893357 r1893383  
    99as follows:
    1010<code>[dotembed url="" title="" dotext="" dotid="" pageext="" pageid="" width="" height="" ratio="" loading="" loadingcolor=""]</code>
    11 Version: 2.2.6
     11Version: 2.2.7
    1212Author: Pedro Figueiredo
    1313Author URI: http://dot.vu
     
    198198}
    199199
     200function get_requires_iframe_fix($user_agent) {
     201  try {
     202    if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return false;
     203    elseif (strpos($user_agent, 'Edge')) return false;
     204    elseif (strpos($user_agent, 'Chrome')) return false;
     205    elseif (strpos($user_agent, 'Safari')) return true;
     206    elseif (strpos($user_agent, 'Firefox')) return false;
     207    elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return true;
     208    return true;
     209  } catch(\Exception $ex) { return true; }
     210}
     211
    200212function dotembed_iframe_fix() {
    201213  try {
    202     if(!is_admin() && $GLOBALS['pagenow'] !== 'wp-login.php') {
     214    if(!is_admin() && $GLOBALS['pagenow'] !== 'wp-login.php' && get_requires_iframe_fix($_SERVER['HTTP_USER_AGENT'])) {
    203215      // do not redirect if coming from embed
    204216      if($_REQUEST['dotembed']) return;
Note: See TracChangeset for help on using the changeset viewer.