Plugin Directory

Changeset 3423180


Ignore:
Timestamp:
12/18/2025 06:38:46 PM (3 months ago)
Author:
cmsjunkie
Message:

Version 3.1.5

  • compatibility fixes with PHP 8.3
  • improved security / fixed vulnerability issues
  • fixed warnings
Location:
wp-businessdirectory/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • wp-businessdirectory/trunk/admin/models/companies.php

    r3281080 r3423180  
    909909
    910910        $pdf->SetFont("DejaVu", "", "30");
    911         $pdf->Cell(0, 20, utf8_decode((JText::_('LNG_MEMBER_DIRECTORY'))), 0, 0, 'C');
     911        $pdf->Cell(0, 20, mb_convert_encoding((JText::_('LNG_MEMBER_DIRECTORY')), 'ISO-8859-1', 'UTF-8'), 0, 0, 'C');
    912912        $pdf->centreImage(BD_PICTURES_PATH .$appSettings->logo);
    913913        $pdf->SetXY(0,260);     
     
    986986
    987987            $pdf->SetXY(39, 20);
    988             $pdf->Cell(0, 83,utf8_decode($company->name), 0, 0, "L");
     988            $pdf->Cell(0, 83,mb_convert_encoding($company->name, 'ISO-8859-1', 'UTF-8'), 0, 0, "L");
    989989            $pdf->SetFont("DejaVu", "", "12");
    990990           
    991991            $pdf->SetTextColor(160,160,176);
    992992            $pdf->SetXY(39, 66);
    993             $pdf->MultiCell(0, 4, utf8_decode(JBusinessUtil::truncate($slogan, 180, '')));
     993            $pdf->MultiCell(0, 4, mb_convert_encoding(JBusinessUtil::truncate($slogan, 180, ''), 'ISO-8859-1', 'UTF-8'));
    994994            $pdf->SetTextColor(0,0,0);
    995995            $pdf->SetXY(10, 80);
     
    10161016            $pdf->SetFont("DejaVu", "", "15");
    10171017            $pdf->SetXY(145,83);
    1018             $pdf->MultiCell(60, 6, !empty($companyCategory->name) ? utf8_decode($companyCategory->name) : "", 0, "L");
     1018            $pdf->MultiCell(60, 6, !empty($companyCategory->name) ? mb_convert_encoding($companyCategory->name, 'ISO-8859-1', 'UTF-8') : "", 0, "L");
    10191019            $pdf->SetTextColor(0);
    10201020            $pdf->Image($siteLogo, 125, 81, 17, 15);
     
    10521052            $pdf->SetXY(140,150);
    10531053            $listingAddress = $company->address." ".$company->city." ".$company->county." ".$company->postalCode ;
    1054             $pdf->MultiCell(0, 5, !empty(trim($listingAddress)) ? utf8_decode($listingAddress) : JText::_('LNG_NOT_PROVIDED'), 0, "L");
     1054            $pdf->MultiCell(0, 5, !empty(trim($listingAddress)) ? mb_convert_encoding($listingAddress, 'ISO-8859-1', 'UTF-8') : JText::_('LNG_NOT_PROVIDED'), 0, "L");
    10551055            $pdf->Line(130,165, 195,165);
    10561056            $pdf->SetXY(130,172);
     
    10591059
    10601060            if(!empty($company->contact_name)) {
    1061                 $pdf->Write(0, utf8_decode(JText::_('LNG_CONTACT_PERSON')));
     1061                $pdf->Write(0, mb_convert_encoding(JText::_('LNG_CONTACT_PERSON'), 'ISO-8859-1', 'UTF-8'));
    10621062                $pdf->SetXY(130, 180);
    10631063                $pdf->SetTextColor(50,50,50);
    10641064                $pdf->SetFont("DejaVu", "", "9");
    1065                 $pdf->Write(0, utf8_decode($company->contact_name));
     1065                $pdf->Write(0, mb_convert_encoding($company->contact_name, 'ISO-8859-1', 'UTF-8'));
    10661066            }
    10671067
     
    10721072            $pdf->SetFont("DejaVu", "", "12");
    10731073
    1074             $pdf->Write(0, utf8_decode(JText::_('LNG_OPENING_TIME')));
     1074            $pdf->Write(0, mb_convert_encoding(JText::_('LNG_OPENING_TIME'), 'ISO-8859-1', 'UTF-8'));
    10751075            $pdf->SetTextColor(50,50,50);
    10761076            $pdf->SetFont("DejaVu", "", "9");
     
    10841084                    $pdf->SetXY(185,$dayIndex*10+200);
    10851085
    1086                     $pdf->Write(0, utf8_decode(JText::_('LNG_CLOSED')));
     1086                    $pdf->Write(0, mb_convert_encoding(JText::_('LNG_CLOSED'), 'ISO-8859-1', 'UTF-8'));
    10871087                }
    10881088                elseif ($day->workHours["status"] != 0 && isset($day->breakHours)) {
     
    11021102            $pdf->SetXY(15,94);
    11031103            $pdf->SetFont("DejaVu", "", "10");
    1104             $pdf->MultiCell(98, 5, utf8_decode(preg_replace('/\s+/', ' ', JBusinessUtil::truncate($description, 1800, ''))));
     1104            $pdf->MultiCell(98, 5, mb_convert_encoding(preg_replace('/\s+/', ' ', JBusinessUtil::truncate($description, 1800, '')), 'ISO-8859-1', 'UTF-8'));
    11051105          }
    11061106        }
     
    11121112            $pdf->SetTextColor(255, 255, 255);
    11131113            $pdf->SetFont("DejaVu", "", "30");
    1114             $pdf->Cell(0, 30, utf8_decode(JText::_('LNG_PDF_GOODBYE_TEXT')), 0, 0, 'C');
     1114            $pdf->Cell(0, 30, mb_convert_encoding(JText::_('LNG_PDF_GOODBYE_TEXT'), 'ISO-8859-1', 'UTF-8'), 0, 0, 'C');
    11151115            $pdf->centreImage(BD_PICTURES_PATH .$appSettings->logo);
    11161116
     
    11191119            $pdf->SetTextColor(255, 255, 255);
    11201120            $pdf->SetXY(0,275);         
    1121             $pdf->Cell(0, 0, utf8_decode($addressText), 0, 0, 'C');
     1121            $pdf->Cell(0, 0, mb_convert_encoding($addressText, 'ISO-8859-1', 'UTF-8'), 0, 0, 'C');
    11221122
    11231123            $pdf->RotatedImage(BD_PICTURES_PATH .$appSettings->no_image,200, 280, 10, 10, 90);
  • wp-businessdirectory/trunk/admin/tables/rating.php

    r2914935 r3423180  
    2626    public function getRating($ratingId) {
    2727        $db =JFactory::getDBO();
     28        $ratingId = (int)$ratingId;
    2829        $query = "select * from #__jbusinessdirectory_company_ratings where id=".$ratingId;
    2930        $db->setQuery($query);
     
    5657    public function getNumberOfRatings($companyId) {
    5758        $db = JFactory::getDBO();
     59        $companyId = (int)$companyId;
    5860        $query = "select count(*) as nrRatings from #__jbusinessdirectory_company_ratings where companyId=".$companyId;
    5961        $db->setQuery($query);
     
    6466    public function deleteRating($ratingId) {
    6567        $db = JFactory::getDBO();
     68        $ratingId = (int)$ratingId;
    6669        $query = "delete from #__jbusinessdirectory_company_ratings WHERE id = ".$ratingId ;
    6770        $db->setQuery($query);
     
    7477    public function updateCompanyRating($companyId) {
    7578        $db =JFactory::getDBO();
     79        $companyId = (int)$companyId;
    7680        $query = "update #__jbusinessdirectory_companies set averageRating=(select avg(rating) from #__jbusinessdirectory_company_ratings where companyId=".$companyId.") where id=".$companyId;
    7781        $db->setQuery($query);
  • wp-businessdirectory/trunk/includes/mvc/language/Language.php

    r3375953 r3423180  
    896896           
    897897            if ($strings === false) {
    898                 dump("ERROR: parse_ini_file failed!");
    899898                if ($lastError) {
    900899                    dump("Last PHP Error: " . print_r($lastError, true));
    901900                }
    902901            } else {
    903                 dump("parse_ini_file successful, found " . count($strings) . " strings");
    904902            }
    905903        }
     
    913911        if ($this->debug || count($strings) == 0)
    914912        {
    915             dump("Running debugFile check...");
    916913            $errorCount = $this->debugFile($filename);
    917             dump("debugFile found " . $errorCount . " errors");
    918914           
    919915            // Log the specific errors
  • wp-businessdirectory/trunk/includes/router.php

    r3375953 r3423180  
    249249
    250250    $directory = isset($_REQUEST['directory'])?sanitize_text_field($_REQUEST['directory']):"";
    251         if (!empty($directory) || $alias=="businessdirectory") {
     251        if (!empty($directory) || $alias=="businessdirectory" || !empty($params)) {
    252252            $session = JFactory::getSession();
    253253            // Avoid altering the_content filters if Divi is active
     
    280280
    281281    $directory = isset($_REQUEST['directory'])?sanitize_text_field($_REQUEST['directory']):"";
    282         if (!empty($directory) || $alias=="businessdirectory") {
     282        if (!empty($directory) || $alias=="businessdirectory" || !empty($params)) {
    283283            $session = JFactory::getSession();
    284284            // Avoid altering the_content filters if Divi is active
  • wp-businessdirectory/trunk/includes/widgets/wp-businessdirectory-listings/helper.php

    r3328377 r3423180  
    2222        if(isset($_REQUEST["video_category"])){
    2323            $cat = $_REQUEST["video_category"];
    24             $catNameFilter = " and cg.name like '%$cat->name%'";
     24            if (is_object($cat)) {
     25                $catNameFilter = " and cg.name like '%".$db->escape($cat->name)."%'";
     26            } else {
     27                $catNameFilter = " and cg.name like '%".$db->escape($cat)."%'";
     28            }
    2529        }
    2630       
    2731        if(isset($_REQUEST["current_listing"]) && $params->get('listing_link')){
    2832            $listing = $_REQUEST["current_listing"];
    29             $catId = $listing->mainSubcategory;
    30             $itemId = $listing->id;
    31             $catNameFilter = " and cg.id = $catId and cp.id!= $itemId";
     33            if (is_object($listing)) {
     34                $catId = (int)$listing->mainSubcategory;
     35                $itemId = (int)$listing->id;
     36                $catNameFilter = " and cg.id = $catId and cp.id!= $itemId";
     37            }
    3238        }
    3339
     
    98104               
    99105                if (!empty($filter)) {
     106                    $key = (int)$key;
    100107                    $customAttrFilterS .=" (ca.attribute_id = $key and ($filter))";
    101108                }
    102109            }
    103110            $customAttrIds = array_keys($customAttributes);
     111            $customAttrIds = array_map('intval', $customAttrIds);
    104112            sort($customAttrIds);
    105113            if (!empty($customAttrFilterS)) {
     
    110118
    111119        if (isset($categoriesIds) && count($categoriesIds)>0 && $categoriesIds[0]!= 0 && $categoriesIds[0]!= "") {
     120            $categoriesIds = array_map('intval', $categoriesIds);
    112121            $categoriesIDs = implode(",", $categoriesIds);
    113122            $whereCatCond = " and cc.categoryId in ($categoriesIDs)";
     
    165174        $whereCountryCond='';
    166175        if (!empty($countryId)) {
    167             $whereCountryCond=" and cp.countryId = ".$db->escape($countryId);
     176            $whereCountryCond=" and cp.countryId = ".(int)$countryId;
    168177        }
    169178
     
    171180        $whereTypeCond='';
    172181        if (!empty($type)) {
    173             $type = $db->escape($type);
     182            $type = (int)$type;
    174183            $whereTypeCond=" and find_in_set($type,cp.typeId) ";
    175184        }
     
    180189        $whereMembershipCondition = "";
    181190        if (!empty($membership)) {
     191            $membership = (int)$membership;
    182192            $leftJoinMemberships = " left join #__jbusinessdirectory_memberships as mmb on mmb.id = $membership";
    183193            $leftJoinCompanyMembership = " left join #__jbusinessdirectory_company_membership as cmb on cmb.company_id = cp.id";
     
    192202        $leftJoinCampaignPlans = "";
    193203        if (!empty($plan) && !empty($onlyCampaigns) && JBusinessUtil::isAppInstalled(JBD_APP_CAMPAIGNS)) {
     204            $plan = (int)$plan;
    194205            $wherePlanCondition = " and cmp.id = $plan and cmg.published = 1 and cmg.status = ".CAMPAIGN_STATUS_PAID." and cmg.budget > 0";
    195206
     
    215226        $radius = $params->get('radius');
    216227        if(!empty($radius)){
    217             $radius = $db->escape($radius);
     228            $radius = floatval($radius);
    218229        }
    219230        $jinput = JFactory::getApplication()->input;
    220231        $latitude = $jinput->get("geo-latitude");
    221232        if(!empty($latitude)){
    222             $latitude = $db->escape($latitude);
     233            $latitude = floatval($latitude);
    223234        }
    224235        $longitude = $jinput->get("geo-longitude");
    225236        if(!empty($longitude)){
    226             $longitude = $db->escape($longitude);
     237            $longitude = floatval($longitude);
    227238        }
    228239
     
    232243            $companyId = $jinput->get('companyId');
    233244            if (!empty($companyId)) {
     245                $companyId = (int)$companyId;
    234246                $company = self::getCompany($companyId);
    235247                $latitude = $company->latitude;
     
    277289        $packages  = $params->get('packages');
    278290        if (!empty($packages) && $enablePackage) {
     291            if(!is_array($packages)){
     292                $packages = explode(",",$packages);
     293            }
     294            $packages = array_map('intval', $packages);
    279295            $packagesIds = implode(",", $packages);
    280296            $wherePackageCond = " and (inv.package_id in ($packagesIds) or p.id in ($packagesIds)) ";
     
    286302        $whereListingsCond = '';
    287303        if ($params->get('show_recently_viewed') && isset($_COOKIE['jbdViewedListings'])) {
    288             $listingIds = explode(",", $_COOKIE['jbdViewedListings']);
     304            $cookieVal = $_COOKIE['jbdViewedListings'];
     305            if (is_array($cookieVal)) {
     306                $listingIds = $cookieVal;
     307            } else {
     308                $listingIds = explode(",", $cookieVal);
     309            }
    289310            $listingIds = array_map('intval', $listingIds);
    290311            $listingIds = array_filter($listingIds);
    291312            if(!empty($listingIds)){
    292313                $listingIds = implode(",",$listingIds);
    293                 $whereListingsCond = "and cp.id in ($listingIds)";
     314                $whereListingsCond = " and cp.id in ($listingIds) ";
    294315            }
    295316        }
     
    455476    public static function getCompany($companyId) {
    456477        $db =JFactory::getDbo();
     478        $companyId = (int)$companyId;
    457479        $query = "select bc.*
    458480        from #__jbusinessdirectory_companies bc
  • wp-businessdirectory/trunk/readme.txt

    r3375953 r3423180  
    55Requires at least: 4.9
    66Tested up to: 6.8.0
    7 Stable tag: 3.1.4
     7Stable tag: 3.1.5
    88Requires PHP: 7.4
    99License: GPLv2 or later
  • wp-businessdirectory/trunk/site/classes/attributes/attributeservice.php

    r3281080 r3423180  
    853853     */
    854854    public static function getAttributeIcons($attribute, $enablePackages, $packageFeatures) {
     855        $attributeIcons = array();
    855856        if (isset($attribute->optionsIcons)) {
    856             $attributeIcons = explode("|#", $attribute->optionsIcons);
     857            $attributeIcons = explode("|#", (string)$attribute->optionsIcons);
    857858        }
    858859        if (!$attribute->show_icon || $attribute->show_in_front != 1) {
     
    863864            switch ($attribute->attributeTypeCode) {
    864865                case "select_box":
    865                     $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);
     866                    $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS);
    866867                    $icons = array();
    867868                    foreach ($attributeIcons as $key => $val) {
     
    878879                    break;
    879880                case "checkbox":
    880                     $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);
    881                     $attributeValues = explode(",", $attribute->attributeValue);
     881                    $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS);
     882                    $attributeValues = explode(",", (string)$attribute->attributeValue);
    882883                    if ($attributeValues[0] == "") {
    883884                        break;
     
    896897                    break;
    897898                case "radio":
    898                     $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);
     899                    $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS);
    899900                    $icons = array();
    900901                    foreach ($attributeIcons as $key => $val) {
     
    911912                    break;
    912913                case "multiselect":
    913                     $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);
    914                     $attributeValues = explode(",", $attribute->attributeValue);
     914                    $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS);
     915                    $attributeValues = explode(",", (string)$attribute->attributeValue);
    915916                    if ($attributeValues[0] == "") {
    916917                        break;
  • wp-businessdirectory/trunk/site/helpers/urltranslator.php

    r3012152 r3423180  
    1818{
    1919   
    20     var $mappings = array("catalog"=>"catalog","listings"=>"search", "offers"=>"offers", "events"=>"events", "control-panel"=>"useroptions","payment-plans"=>"packages",
     20    var $mappings = array("businessdirectory"=>"search","catalog"=>"catalog","listings"=>"search", "offers"=>"offers", "events"=>"events", "control-panel"=>"useroptions","payment-plans"=>"packages",
    2121                        "categories"=>"categories",
    2222                        "user-dashboard"=>"userdashboard",
     
    4444
    4545        global $wp;
    46         $base_url = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on' ? 'https' : 'http' ) . '://' .  $_SERVER['HTTP_HOST'];
    47         $url = $base_url . $_SERVER["REQUEST_URI"];
    48        
    49         $url = str_replace(add_query_arg($wp->query_vars, home_url())."/", "", $url);
    50         $url = "/".$url;
    51         $url = str_replace("/index.php", "", $url);
     46        $current_url = $_SERVER["REQUEST_URI"];
     47        if (strpos($current_url, "?") !== false) {
     48            $current_url = substr($current_url, 0, strpos($current_url, "?"));
     49        }
     50
     51        $home_path = trim(parse_url(home_url(), PHP_URL_PATH), '/');
     52        $current_url = trim($current_url, "/");
     53        if ($home_path && strpos($current_url, $home_path) === 0) {
     54            $current_url = trim(substr($current_url, strlen($home_path)), '/');
     55        }
     56
     57        $url = trim($current_url, "/");
    5258        $url = str_replace("index.php", "", $url);
     59        $url = trim($url, "/");
    5360
    5461        $lang = JBusinessUtil::getCurrentLanguageCode();
    55         $url = str_replace("/".$lang."/","",$url);
    56         if(!empty($appSettings->url_menu_alias)){
    57             $url = str_replace($appSettings->url_menu_alias."/","",$url);
    58         }
    59        
    60         if(strpos($url,"/") === 0){
    61             $url = substr($url,1);
     62        $url = preg_replace("~^" . $lang . "(/|$)~", "", $url);
     63        $url = trim($url, "/");
     64
     65        if (!empty($appSettings->url_menu_alias)) {
     66            $url = preg_replace("~^" . $appSettings->url_menu_alias . "(/|$)~", "", $url);
     67            $url = trim($url, "/");
    6268        }
    6369
    6470        $pieces = explode("/", $url);
    65         if (count($pieces)>1) {
    66             $keyword= end($pieces);
     71        $pieces = array_filter($pieces);
     72        if (count($pieces) > 1) {
     73            $keyword = end($pieces);
    6774            $category = reset($pieces);
    6875        } else {
    6976            $keyword = $url;
     77            $category = $url;
    7078        }
    7179       
  • wp-businessdirectory/trunk/site/helpers/utils.php

    r3375953 r3423180  
    88 */
    99
    10 use MVC\Factory;
    11 use MVC\HTML\HTMLHelper;
    12 use AllowDynamicProperties;
    1310
    1411/**
     
    1916 *
    2017 */
    21 #[\AllowDynamicProperties]
    2218class JBusinessUtil {
    2319    public $applicationSettings ;
     
    11141110     */
    11151111    public static function convertToFormat($date) {
    1116         if (isset($date) && strlen($date)>6 && $date!="0000-00-00" && $date!="00-00-0000") {
     1112        if (isset($date) && strlen((string)$date)>6 && $date!="0000-00-00" && $date!="00-00-0000") {
    11171113            try {
    11181114                $appSettings = JBusinessUtil::getApplicationSettings();
    1119                 $date = substr($date, 0, 10);
    1120                 list($yy, $mm, $dd)=explode("-", $date);
     1115                $date = substr((string)$date, 0, 10);
     1116                list($yy, $mm, $dd)=explode("-", (string)$date);
    11211117                if (is_numeric($yy) && is_numeric($mm) && is_numeric($dd)) {
    1122                     $date = date($appSettings->dateFormat, strtotime($date));
     1118                    $date = date($appSettings->dateFormat, strtotime((string)$date));
    11231119                } else {
    11241120                    $date=null;
     
    11401136        if (strpos((string)$date, "00-00-00")!==false) {
    11411137            return $date;
    1142         } elseif (!empty($date) && strlen($date)>6) {
    1143             $date = date("Y-m-d", strtotime($date));
     1138        } elseif (!empty($date) && strlen((string)$date)>6) {
     1139            $date = date("Y-m-d", strtotime((string)$date));
    11441140        } else {
    11451141            $date = null;
     
    11561152    public static function getDateGeneralFormat($data) {
    11571153        $dateS="";
    1158         if (isset($data) && strlen($data)>6  && $data!="0000-00-00" && $data != "current_timestamp()") {
     1154        if (isset($data) && strlen((string)$data)>6  && $data!="0000-00-00" && $data != "current_timestamp()") {
    11591155            //$data =strtotime($data);
    11601156            //setlocale(LC_ALL, 'de_DE');
    11611157            //$dateS = strftime( '%e %B %Y', $data );
    1162             $date = JFactory::getDate($data);
     1158            $date = JFactory::getDate((string)$data);
    11631159            $dateS = $date->format('j F Y');
    11641160            //$dateS = date( 'j F Y', $data );
     
    11761172    public static function getDateISOFormat($data, $time = "") {
    11771173        $dateS="";
    1178         if (isset($data) && strlen($data)>6  && $data!="0000-00-00" && $data != "current_timestamp()") {
     1174        if (isset($data) && strlen((string)$data)>6  && $data!="0000-00-00" && $data != "current_timestamp()") {
    11791175            //$data =strtotime($data);
    11801176            //setlocale(LC_ALL, 'de_DE');
     
    11821178
    11831179            if(!empty($time)){
    1184                 $date = JFactory::getDate($data." ".$time);
     1180                $date = JFactory::getDate((string)$data." ".(string)$time);
    11851181                $dateS = $date->format('Y-m-dTH:m:s');
    11861182            }else{
    1187                 $date = JFactory::getDate($data);
     1183                $date = JFactory::getDate((string)$data);
    11881184                $dateS = $date->format('Y-m-d');
    11891185            }
     
    12011197    public static function getDateGeneralShortFormat($data) {
    12021198        $dateS="";
    1203         if (isset($data) && strlen($data)>6  && $data!="0000-00-00" && $data != "current_timestamp()") {
     1199        if (isset($data) && strlen((string)$data)>6  && $data!="0000-00-00" && $data != "current_timestamp()") {
    12041200            //$data =strtotime($data);
    12051201            //$dateS = strftime( '%e %b %Y', $data );
    12061202            //$dateS = date( 'j M Y', $data );
    1207             $date = JFactory::getDate($data);
     1203            $date = JFactory::getDate((string)$data);
    12081204            $dateS = $date->format('j M Y');
    12091205        }
     
    12221218            return null;
    12231219        }
    1224         $date = JFactory::getDate($data);
     1220        $date = JFactory::getDate((string)$data);
    12251221        $dateS =  $date->format('j M Y | G:i:s');
    12261222   
     
    12401236        }
    12411237       
    1242         $date = JFactory::getDate($data);
     1238        $date = JFactory::getDate((string)$data);
    12431239        $dateS = $date->format('M j');
    12441240   
     
    43374333            preg_match("/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/", $url, $matches);
    43384334            $id = $matches[3];
    4339             $hash = unserialize(self::getURLData("https://vimeo.com/api/v2/video/".$id.".php"));
    4340             $thumbnail = $hash[0]['thumbnail_large'];
     4335            $videoData = self::getURLData("https://vimeo.com/api/v2/video/".$id.".php");
     4336            if(!empty($videoData)){
     4337                $hash = unserialize((string)$videoData);
     4338                $thumbnail = isset($hash[0]['thumbnail_large']) ? $hash[0]['thumbnail_large'] : "";
     4339            }else{
     4340                $thumbnail = "";
     4341            }
    43414342
    43424343            $data = array(
     
    45794580       
    45804581        if(!empty($cityName)){
     4582            $db =JFactory::getDBO();
    45814583            $regionFilter = "";
    45824584            if(!empty($regionId)){
    4583                 $regionFilter = "and region_id = $regionId ";
    4584             }
    4585 
    4586             $db =JFactory::getDBO();
    4587             $query = "select * from #__jbusinessdirectory_cities where name='$cityName' $regionFilter";
     4585                $regionFilter = "and region_id = ".(int)$regionId." ";
     4586            }
     4587
     4588            $query = "select * from #__jbusinessdirectory_cities where name='".$db->escape($cityName)."' $regionFilter";
    45884589            $db->setQuery($query);
    45894590            $city = $db->loadObject();
     
    46184619       
    46194620        if(!empty($regionName)){
     4621            $db =JFactory::getDBO();
    46204622            $countryFilter = "";
    46214623            if(!empty($countryId)){
    4622                 $countryFilter = "and country_id = $countryId";
    4623             }
    4624             $db =JFactory::getDBO();
    4625             $query = "select * from #__jbusinessdirectory_regions where name='$regionName' $countryFilter";
     4624                $countryFilter = "and country_id = ".(int)$countryId;
     4625            }
     4626            $query = "select * from #__jbusinessdirectory_regions where name='".$db->escape($regionName)."' $countryFilter";
    46264627            $db->setQuery($query);
    46274628            $region = $db->loadObject();
     
    46614662            return "";
    46624663        }else{
    4663             if(is_int($countryId)){
     4664            if(is_numeric($countryId)){
    46644665                $country =  $instance::getCountry($countryId);
    46654666                if(!empty($country)){
     
    46914692        if (!isset($instance->countries[$countryId])) {
    46924693            $db =JFactory::getDBO();
    4693             $query = "select * from #__jbusinessdirectory_countries where id = $countryId ";
     4694            $query = "select * from #__jbusinessdirectory_countries where id = ".(int)$countryId;
    46944695            $db->setQuery($query);
    46954696            $country = $db->loadObject();
     
    47294730        if (!isset($instance->countries[$country])) {
    47304731            $db =JFactory::getDBO();
    4731             $query = "select * from #__jbusinessdirectory_countries where country_name = '$country' ";
     4732            $query = "select * from #__jbusinessdirectory_countries where country_name = '".$db->escape($country)."' ";
    47324733            $db->setQuery($query);
    47334734            $countryObj = $db->loadObject();
  • wp-businessdirectory/trunk/wp-businessdirectory.php

    r3375953 r3423180  
    55 * Description: Professional Business Directory
    66 * Author: CMSJunkie
    7  * Version: 3.1.4
     7 * Version: 3.1.5
    88 * Author URI: https://www.cmsjunkie.com
    99  */
    1010/**
    11  * @copyright   Copyright (C) 2008-2021 CMSJunkie. All rights reserved.
     11 * @copyright   Copyright (C) 2008-2026 CMSJunkie. All rights reserved.
    1212 *
    1313 * This program is free software: you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.