Changeset 3423180
- Timestamp:
- 12/18/2025 06:38:46 PM (3 months ago)
- Location:
- wp-businessdirectory/trunk
- Files:
-
- 10 edited
-
admin/models/companies.php (modified) (10 diffs)
-
admin/tables/rating.php (modified) (4 diffs)
-
includes/mvc/language/Language.php (modified) (2 diffs)
-
includes/router.php (modified) (2 diffs)
-
includes/widgets/wp-businessdirectory-listings/helper.php (modified) (12 diffs)
-
readme.txt (modified) (1 diff)
-
site/classes/attributes/attributeservice.php (modified) (5 diffs)
-
site/helpers/urltranslator.php (modified) (2 diffs)
-
site/helpers/utils.php (modified) (16 diffs)
-
wp-businessdirectory.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-businessdirectory/trunk/admin/models/companies.php
r3281080 r3423180 909 909 910 910 $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'); 912 912 $pdf->centreImage(BD_PICTURES_PATH .$appSettings->logo); 913 913 $pdf->SetXY(0,260); … … 986 986 987 987 $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"); 989 989 $pdf->SetFont("DejaVu", "", "12"); 990 990 991 991 $pdf->SetTextColor(160,160,176); 992 992 $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')); 994 994 $pdf->SetTextColor(0,0,0); 995 995 $pdf->SetXY(10, 80); … … 1016 1016 $pdf->SetFont("DejaVu", "", "15"); 1017 1017 $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"); 1019 1019 $pdf->SetTextColor(0); 1020 1020 $pdf->Image($siteLogo, 125, 81, 17, 15); … … 1052 1052 $pdf->SetXY(140,150); 1053 1053 $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"); 1055 1055 $pdf->Line(130,165, 195,165); 1056 1056 $pdf->SetXY(130,172); … … 1059 1059 1060 1060 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')); 1062 1062 $pdf->SetXY(130, 180); 1063 1063 $pdf->SetTextColor(50,50,50); 1064 1064 $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')); 1066 1066 } 1067 1067 … … 1072 1072 $pdf->SetFont("DejaVu", "", "12"); 1073 1073 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')); 1075 1075 $pdf->SetTextColor(50,50,50); 1076 1076 $pdf->SetFont("DejaVu", "", "9"); … … 1084 1084 $pdf->SetXY(185,$dayIndex*10+200); 1085 1085 1086 $pdf->Write(0, utf8_decode(JText::_('LNG_CLOSED')));1086 $pdf->Write(0, mb_convert_encoding(JText::_('LNG_CLOSED'), 'ISO-8859-1', 'UTF-8')); 1087 1087 } 1088 1088 elseif ($day->workHours["status"] != 0 && isset($day->breakHours)) { … … 1102 1102 $pdf->SetXY(15,94); 1103 1103 $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')); 1105 1105 } 1106 1106 } … … 1112 1112 $pdf->SetTextColor(255, 255, 255); 1113 1113 $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'); 1115 1115 $pdf->centreImage(BD_PICTURES_PATH .$appSettings->logo); 1116 1116 … … 1119 1119 $pdf->SetTextColor(255, 255, 255); 1120 1120 $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'); 1122 1122 1123 1123 $pdf->RotatedImage(BD_PICTURES_PATH .$appSettings->no_image,200, 280, 10, 10, 90); -
wp-businessdirectory/trunk/admin/tables/rating.php
r2914935 r3423180 26 26 public function getRating($ratingId) { 27 27 $db =JFactory::getDBO(); 28 $ratingId = (int)$ratingId; 28 29 $query = "select * from #__jbusinessdirectory_company_ratings where id=".$ratingId; 29 30 $db->setQuery($query); … … 56 57 public function getNumberOfRatings($companyId) { 57 58 $db = JFactory::getDBO(); 59 $companyId = (int)$companyId; 58 60 $query = "select count(*) as nrRatings from #__jbusinessdirectory_company_ratings where companyId=".$companyId; 59 61 $db->setQuery($query); … … 64 66 public function deleteRating($ratingId) { 65 67 $db = JFactory::getDBO(); 68 $ratingId = (int)$ratingId; 66 69 $query = "delete from #__jbusinessdirectory_company_ratings WHERE id = ".$ratingId ; 67 70 $db->setQuery($query); … … 74 77 public function updateCompanyRating($companyId) { 75 78 $db =JFactory::getDBO(); 79 $companyId = (int)$companyId; 76 80 $query = "update #__jbusinessdirectory_companies set averageRating=(select avg(rating) from #__jbusinessdirectory_company_ratings where companyId=".$companyId.") where id=".$companyId; 77 81 $db->setQuery($query); -
wp-businessdirectory/trunk/includes/mvc/language/Language.php
r3375953 r3423180 896 896 897 897 if ($strings === false) { 898 dump("ERROR: parse_ini_file failed!");899 898 if ($lastError) { 900 899 dump("Last PHP Error: " . print_r($lastError, true)); 901 900 } 902 901 } else { 903 dump("parse_ini_file successful, found " . count($strings) . " strings");904 902 } 905 903 } … … 913 911 if ($this->debug || count($strings) == 0) 914 912 { 915 dump("Running debugFile check...");916 913 $errorCount = $this->debugFile($filename); 917 dump("debugFile found " . $errorCount . " errors");918 914 919 915 // Log the specific errors -
wp-businessdirectory/trunk/includes/router.php
r3375953 r3423180 249 249 250 250 $directory = isset($_REQUEST['directory'])?sanitize_text_field($_REQUEST['directory']):""; 251 if (!empty($directory) || $alias=="businessdirectory" ) {251 if (!empty($directory) || $alias=="businessdirectory" || !empty($params)) { 252 252 $session = JFactory::getSession(); 253 253 // Avoid altering the_content filters if Divi is active … … 280 280 281 281 $directory = isset($_REQUEST['directory'])?sanitize_text_field($_REQUEST['directory']):""; 282 if (!empty($directory) || $alias=="businessdirectory" ) {282 if (!empty($directory) || $alias=="businessdirectory" || !empty($params)) { 283 283 $session = JFactory::getSession(); 284 284 // Avoid altering the_content filters if Divi is active -
wp-businessdirectory/trunk/includes/widgets/wp-businessdirectory-listings/helper.php
r3328377 r3423180 22 22 if(isset($_REQUEST["video_category"])){ 23 23 $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 } 25 29 } 26 30 27 31 if(isset($_REQUEST["current_listing"]) && $params->get('listing_link')){ 28 32 $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 } 32 38 } 33 39 … … 98 104 99 105 if (!empty($filter)) { 106 $key = (int)$key; 100 107 $customAttrFilterS .=" (ca.attribute_id = $key and ($filter))"; 101 108 } 102 109 } 103 110 $customAttrIds = array_keys($customAttributes); 111 $customAttrIds = array_map('intval', $customAttrIds); 104 112 sort($customAttrIds); 105 113 if (!empty($customAttrFilterS)) { … … 110 118 111 119 if (isset($categoriesIds) && count($categoriesIds)>0 && $categoriesIds[0]!= 0 && $categoriesIds[0]!= "") { 120 $categoriesIds = array_map('intval', $categoriesIds); 112 121 $categoriesIDs = implode(",", $categoriesIds); 113 122 $whereCatCond = " and cc.categoryId in ($categoriesIDs)"; … … 165 174 $whereCountryCond=''; 166 175 if (!empty($countryId)) { 167 $whereCountryCond=" and cp.countryId = ". $db->escape($countryId);176 $whereCountryCond=" and cp.countryId = ".(int)$countryId; 168 177 } 169 178 … … 171 180 $whereTypeCond=''; 172 181 if (!empty($type)) { 173 $type = $db->escape($type);182 $type = (int)$type; 174 183 $whereTypeCond=" and find_in_set($type,cp.typeId) "; 175 184 } … … 180 189 $whereMembershipCondition = ""; 181 190 if (!empty($membership)) { 191 $membership = (int)$membership; 182 192 $leftJoinMemberships = " left join #__jbusinessdirectory_memberships as mmb on mmb.id = $membership"; 183 193 $leftJoinCompanyMembership = " left join #__jbusinessdirectory_company_membership as cmb on cmb.company_id = cp.id"; … … 192 202 $leftJoinCampaignPlans = ""; 193 203 if (!empty($plan) && !empty($onlyCampaigns) && JBusinessUtil::isAppInstalled(JBD_APP_CAMPAIGNS)) { 204 $plan = (int)$plan; 194 205 $wherePlanCondition = " and cmp.id = $plan and cmg.published = 1 and cmg.status = ".CAMPAIGN_STATUS_PAID." and cmg.budget > 0"; 195 206 … … 215 226 $radius = $params->get('radius'); 216 227 if(!empty($radius)){ 217 $radius = $db->escape($radius);228 $radius = floatval($radius); 218 229 } 219 230 $jinput = JFactory::getApplication()->input; 220 231 $latitude = $jinput->get("geo-latitude"); 221 232 if(!empty($latitude)){ 222 $latitude = $db->escape($latitude);233 $latitude = floatval($latitude); 223 234 } 224 235 $longitude = $jinput->get("geo-longitude"); 225 236 if(!empty($longitude)){ 226 $longitude = $db->escape($longitude);237 $longitude = floatval($longitude); 227 238 } 228 239 … … 232 243 $companyId = $jinput->get('companyId'); 233 244 if (!empty($companyId)) { 245 $companyId = (int)$companyId; 234 246 $company = self::getCompany($companyId); 235 247 $latitude = $company->latitude; … … 277 289 $packages = $params->get('packages'); 278 290 if (!empty($packages) && $enablePackage) { 291 if(!is_array($packages)){ 292 $packages = explode(",",$packages); 293 } 294 $packages = array_map('intval', $packages); 279 295 $packagesIds = implode(",", $packages); 280 296 $wherePackageCond = " and (inv.package_id in ($packagesIds) or p.id in ($packagesIds)) "; … … 286 302 $whereListingsCond = ''; 287 303 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 } 289 310 $listingIds = array_map('intval', $listingIds); 290 311 $listingIds = array_filter($listingIds); 291 312 if(!empty($listingIds)){ 292 313 $listingIds = implode(",",$listingIds); 293 $whereListingsCond = " and cp.id in ($listingIds)";314 $whereListingsCond = " and cp.id in ($listingIds) "; 294 315 } 295 316 } … … 455 476 public static function getCompany($companyId) { 456 477 $db =JFactory::getDbo(); 478 $companyId = (int)$companyId; 457 479 $query = "select bc.* 458 480 from #__jbusinessdirectory_companies bc -
wp-businessdirectory/trunk/readme.txt
r3375953 r3423180 5 5 Requires at least: 4.9 6 6 Tested up to: 6.8.0 7 Stable tag: 3.1. 47 Stable tag: 3.1.5 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later -
wp-businessdirectory/trunk/site/classes/attributes/attributeservice.php
r3281080 r3423180 853 853 */ 854 854 public static function getAttributeIcons($attribute, $enablePackages, $packageFeatures) { 855 $attributeIcons = array(); 855 856 if (isset($attribute->optionsIcons)) { 856 $attributeIcons = explode("|#", $attribute->optionsIcons);857 $attributeIcons = explode("|#", (string)$attribute->optionsIcons); 857 858 } 858 859 if (!$attribute->show_icon || $attribute->show_in_front != 1) { … … 863 864 switch ($attribute->attributeTypeCode) { 864 865 case "select_box": 865 $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);866 $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS); 866 867 $icons = array(); 867 868 foreach ($attributeIcons as $key => $val) { … … 878 879 break; 879 880 case "checkbox": 880 $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);881 $attributeValues = explode(",", $attribute->attributeValue);881 $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS); 882 $attributeValues = explode(",", (string)$attribute->attributeValue); 882 883 if ($attributeValues[0] == "") { 883 884 break; … … 896 897 break; 897 898 case "radio": 898 $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);899 $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS); 899 900 $icons = array(); 900 901 foreach ($attributeIcons as $key => $val) { … … 911 912 break; 912 913 case "multiselect": 913 $attributeOptionsIDS = explode("|#", $attribute->optionsIDS);914 $attributeValues = explode(",", $attribute->attributeValue);914 $attributeOptionsIDS = explode("|#", (string)$attribute->optionsIDS); 915 $attributeValues = explode(",", (string)$attribute->attributeValue); 915 916 if ($attributeValues[0] == "") { 916 917 break; -
wp-businessdirectory/trunk/site/helpers/urltranslator.php
r3012152 r3423180 18 18 { 19 19 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", 21 21 "categories"=>"categories", 22 22 "user-dashboard"=>"userdashboard", … … 44 44 45 45 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, "/"); 52 58 $url = str_replace("index.php", "", $url); 59 $url = trim($url, "/"); 53 60 54 61 $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, "/"); 62 68 } 63 69 64 70 $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); 67 74 $category = reset($pieces); 68 75 } else { 69 76 $keyword = $url; 77 $category = $url; 70 78 } 71 79 -
wp-businessdirectory/trunk/site/helpers/utils.php
r3375953 r3423180 8 8 */ 9 9 10 use MVC\Factory;11 use MVC\HTML\HTMLHelper;12 use AllowDynamicProperties;13 10 14 11 /** … … 19 16 * 20 17 */ 21 #[\AllowDynamicProperties]22 18 class JBusinessUtil { 23 19 public $applicationSettings ; … … 1114 1110 */ 1115 1111 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") { 1117 1113 try { 1118 1114 $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); 1121 1117 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)); 1123 1119 } else { 1124 1120 $date=null; … … 1140 1136 if (strpos((string)$date, "00-00-00")!==false) { 1141 1137 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)); 1144 1140 } else { 1145 1141 $date = null; … … 1156 1152 public static function getDateGeneralFormat($data) { 1157 1153 $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()") { 1159 1155 //$data =strtotime($data); 1160 1156 //setlocale(LC_ALL, 'de_DE'); 1161 1157 //$dateS = strftime( '%e %B %Y', $data ); 1162 $date = JFactory::getDate( $data);1158 $date = JFactory::getDate((string)$data); 1163 1159 $dateS = $date->format('j F Y'); 1164 1160 //$dateS = date( 'j F Y', $data ); … … 1176 1172 public static function getDateISOFormat($data, $time = "") { 1177 1173 $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()") { 1179 1175 //$data =strtotime($data); 1180 1176 //setlocale(LC_ALL, 'de_DE'); … … 1182 1178 1183 1179 if(!empty($time)){ 1184 $date = JFactory::getDate( $data." ".$time);1180 $date = JFactory::getDate((string)$data." ".(string)$time); 1185 1181 $dateS = $date->format('Y-m-dTH:m:s'); 1186 1182 }else{ 1187 $date = JFactory::getDate( $data);1183 $date = JFactory::getDate((string)$data); 1188 1184 $dateS = $date->format('Y-m-d'); 1189 1185 } … … 1201 1197 public static function getDateGeneralShortFormat($data) { 1202 1198 $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()") { 1204 1200 //$data =strtotime($data); 1205 1201 //$dateS = strftime( '%e %b %Y', $data ); 1206 1202 //$dateS = date( 'j M Y', $data ); 1207 $date = JFactory::getDate( $data);1203 $date = JFactory::getDate((string)$data); 1208 1204 $dateS = $date->format('j M Y'); 1209 1205 } … … 1222 1218 return null; 1223 1219 } 1224 $date = JFactory::getDate( $data);1220 $date = JFactory::getDate((string)$data); 1225 1221 $dateS = $date->format('j M Y | G:i:s'); 1226 1222 … … 1240 1236 } 1241 1237 1242 $date = JFactory::getDate( $data);1238 $date = JFactory::getDate((string)$data); 1243 1239 $dateS = $date->format('M j'); 1244 1240 … … 4337 4333 preg_match("/https?:\/\/(?:www\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/", $url, $matches); 4338 4334 $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 } 4341 4342 4342 4343 $data = array( … … 4579 4580 4580 4581 if(!empty($cityName)){ 4582 $db =JFactory::getDBO(); 4581 4583 $regionFilter = ""; 4582 4584 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"; 4588 4589 $db->setQuery($query); 4589 4590 $city = $db->loadObject(); … … 4618 4619 4619 4620 if(!empty($regionName)){ 4621 $db =JFactory::getDBO(); 4620 4622 $countryFilter = ""; 4621 4623 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"; 4626 4627 $db->setQuery($query); 4627 4628 $region = $db->loadObject(); … … 4661 4662 return ""; 4662 4663 }else{ 4663 if(is_ int($countryId)){4664 if(is_numeric($countryId)){ 4664 4665 $country = $instance::getCountry($countryId); 4665 4666 if(!empty($country)){ … … 4691 4692 if (!isset($instance->countries[$countryId])) { 4692 4693 $db =JFactory::getDBO(); 4693 $query = "select * from #__jbusinessdirectory_countries where id = $countryId ";4694 $query = "select * from #__jbusinessdirectory_countries where id = ".(int)$countryId; 4694 4695 $db->setQuery($query); 4695 4696 $country = $db->loadObject(); … … 4729 4730 if (!isset($instance->countries[$country])) { 4730 4731 $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)."' "; 4732 4733 $db->setQuery($query); 4733 4734 $countryObj = $db->loadObject(); -
wp-businessdirectory/trunk/wp-businessdirectory.php
r3375953 r3423180 5 5 * Description: Professional Business Directory 6 6 * Author: CMSJunkie 7 * Version: 3.1. 47 * Version: 3.1.5 8 8 * Author URI: https://www.cmsjunkie.com 9 9 */ 10 10 /** 11 * @copyright Copyright (C) 2008-202 1CMSJunkie. All rights reserved.11 * @copyright Copyright (C) 2008-2026 CMSJunkie. All rights reserved. 12 12 * 13 13 * This program is free software: you can redistribute it and/or modify
Note: See TracChangeset
for help on using the changeset viewer.