*

rooman

  • ****
  • 231 posts
Location warnings
« on: June 05, 2023, 04:05:24 PM »
1- PHP Warning:  Trying to access array offset on value of type null in /home/***/public_html/oc-content/themes/epsilon/functions.php on line 702
Code: [Select]
// GET LOCATION COOKIES
function eps_location_from_cookies() {
  if(eps_param('default_location') == 1 && isset($_COOKIE['epsLocation']) && $_COOKIE['epsLocation'] != '') {
    $data = json_decode($_COOKIE['epsLocation'], true);
    $data['success'] == isset($data['success']) ? $data['success'] : false;
    return $data;
  }
 
  return array('success' => false);
}
2- PHP Warning:  Trying to access array offset on value of type null in /home/***/public_html/oc-content/themes/epsilon/header.php on line 56
Code: [Select]
<?php if(eps_param('default_location') == 1) { ?>
        <a class="location btn btn-white<?php echo ($location_cookie['success'] === true ' active' ''); ?>" href="#">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" width="18" height="18"><path d="M347.94 129.86L203.6 195.83a31.938 31.938 0 0 0-15.77 15.77l-65.97 144.34c-7.61 16.65 9.54 33.81 26.2 26.2l144.34-65.97a31.938 31.938 0 0 0 15.77-15.77l65.97-144.34c7.61-16.66-9.54-33.81-26.2-26.2zm-77.36 148.72c-12.47 12.47-32.69 12.47-45.16 0-12.47-12.47-12.47-32.69 0-45.16 12.47-12.47 32.69-12.47 45.16 0 12.47 12.47 12.47 32.69 0 45.16zM248 8C111.03 8 0 119.03 0 256s111.03 248 248 248 248-111.03 248-248S384.97 8 248 8zm0 448c-110.28 0-200-89.72-200-200S137.72 56 248 56s200 89.72 200 200-89.72 200-200 200z"/></svg>

          <?php 
            
if(@$location_cookie['success'] !== true) {
              
_e('Location''epsilon');
            } else {
              echo @
$location_cookie['s_location'] <> '' osc_location_native_name_selector($location_cookie's_name') : __('Location''epsilon');
            }
          
?>

        </a>
      <?php ?>
3- PHP Warning:  Trying to access array offset on value of type null in /home/***/public_html/oc-content/themes/epsilon/header.php on line 121
Code: [Select]
<?php if($location_cookie['success'] == true) { ?>
        <?php if($location_cookie['fk_i_city_id'] > 0) { ?>
          <input type="hidden" class="loc-inp" name="sCity" value="<?php echo osc_esc_html($location_cookie['fk_i_city_id']); ?>"/>
        <?php } else if($location_cookie['fk_i_region_id'] > 0) { ?>
          <input type="hidden" class="loc-inp" name="sRegion" value="<?php echo osc_esc_html($location_cookie['fk_i_region_id']); ?>"/>
        <?php } else if($location_cookie['fk_c_country_code'] <> '') { ?>
          <input type="hidden" class="loc-inp" name="sCountry" value="<?php echo osc_esc_html($location_cookie['fk_c_country_code']); ?>"/>
        <?php ?>
      <?php ?>
4- PHP Warning:  Trying to access array offset on value of type null in /home/***/public_html/oc-content/themes/epsilon/functions.php on line 539
Code: [Select]
// CHANGE LOCATION IN SEARCH ROW
function eps_location_default_row() {
  $location_cookie = eps_location_from_cookies();

  if($location_cookie['success'] == true) {
    ?>
    <div class="row defloc">
      <a href="#" class="change-search-location">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="20" height="20"><path d="M256 168c-48.6 0-88 39.4-88 88s39.4 88 88 88 88-39.4 88-88-39.4-88-88-88zm0 128c-22.06 0-40-17.94-40-40s17.94-40 40-40 40 17.94 40 40-17.94 40-40 40zm240-64h-49.66C435.49 145.19 366.81 76.51 280 65.66V16c0-8.84-7.16-16-16-16h-16c-8.84 0-16 7.16-16 16v49.66C145.19 76.51 76.51 145.19 65.66 232H16c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h49.66C76.51 366.81 145.19 435.49 232 446.34V496c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16v-49.66C366.81 435.49 435.49 366.8 446.34 280H496c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zM256 400c-79.4 0-144-64.6-144-144s64.6-144 144-144 144 64.6 144 144-64.6 144-144 144z"></path></svg>
        <?php echo sprintf(__('Searching only in %s (your default location)''epsilon'), osc_location_native_name_selector($location_cookie's_name')); ?>
        <i class="fas fa-times-circle input-clean"></i>
      </a>
    </div>
    <?php 
  
}  
}
5-  PHP Warning:  Trying to access array offset on value of type null in /home/***/public_html/oc-content/themes/epsilon/functions.php on line 3050
Code: [Select]
if($lat == '' && $lon == '') {
    $location_cookie = eps_location_from_cookies();

    if($location_cookie['success'] == true) {
      $lat = (@$location_cookie['d_device_coord_lat'] <> '' ? $location_cookie['d_device_coord_lat'] : @$location_cookie['d_coord_lat']);
      $lon = (@$location_cookie['d_device_coord_long'] <> '' ? $location_cookie['d_device_coord_long'] : @$location_cookie['d_coord_long']);
    }
  }





*

MB Themes

Re: Location warnings
« Reply #1 on: June 05, 2023, 05:12:05 PM »
Thanks for feedback, will fix in next update
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots