If yall have a moment go read my introductions. The short version is that I lost a lot of my memory due to a fall I had in 2014 while working for the big blue retail store with one or two registers open! haha. I am not allowed to talk about it so maybe you will know who I am referring too. Anyhow before that I was pretty knowledgeable and was doing great at fixing things as they came up. Now unfortunately while working on something my mind sometimes slips and I forget what I was working on and cant solve issues. The last couple of days has been a struggle for me. I have a error showing up and I know its got to be a stupidly simple fix I am overlooking or overthinking and I cant figure it out. The first issue I resolved. It was a typo. But this one is out to corrupt my brain even more, every time I go to think about it my brain craps out on me and I begin phasing out as I look onward on the screen. The error is filling my log full of entries over this one simple issue. I think its something to do with a facebook addition we added a few years back.
The Errors are:
htmlspecialchars() expects parameter 2 to be long, string given in class.opengraph.php at 67
File Line Function
_LOG->HandlePHPErrors
class.opengraph.php 67 htmlspecialchars
class.page.php 249 s_OPENGRAPH::getMetaTags
class.page.php 187 _PAGE->ShowPage
pages.php 5 _PAGE->HandlePage
I think I fixed this one below, look at the code and you can double check.
Use of undefined constant ENT_IGNORE - assumed 'ENT_IGNORE' in class.opengraph.php at 67
File Line Function
class.opengraph.php 67 _LOG->HandlePHPErrors
class.page.php 249 _OPENGRAPH::getMetaTags
class.page.php 187 _PAGE->ShowPage
pages.php 5 _PAGE->HandlePage
<?php
class ISC_OPENGRAPH {
/**
* Gets a list of valid object types
*
* @param bool $includeLabels Set to true to return an associative array that includes the labels for each type
* @return array The array of object types
*/
public static function getObjectTypes($includeLabels = false)
{
$objectTypes = array(
'product' => GetLang('TypeProduct'),
'album' => GetLang('TypeAlbum'),
'book' => GetLang('TypeBook'),
'drink' => GetLang('TypeDrink'),
'food' => GetLang('TypeFood'),
'game' => GetLang('TypeGame'),
'movie' => GetLang('TypeMovie'),
'song' => GetLang('TypeSong'),
'tv_show' => GetLang('TypeTVShow'),
);
if (!$includeLabels) {
return array_keys($objectTypes);
}
return $objectTypes;
}
/**
* Generates meta HTML tags using the Open Graph schema
*
* @param string $type The object type
* @param string $title The object's title
* @param string $description Description of the object
* @param string $image URL to an image of the object
* @param string $url The URL to the object itself
* @return string The HTML meta tags
*/
public static function getMetaTags($type = 'product', $title = '', $description = '', $image = '', $url = '')
{
$imgfile = parse_url(urldecode($image));
if(isset($imgfile['fragment'])){
$localfile = $_SERVER['DOCUMENT_ROOT'].$imgfile['path'].'#'.$imgfile['fragment'];
}else{
$localfile = $_SERVER['DOCUMENT_ROOT'].$imgfile['path'];
}
list($width, $height) = getimagesize("$localfile");
$tags = array(
'og:type' => $type,
'og:title' => $title,
'og:description' => $description,
'og:image' => $image,
'og:image:width' => $width,
'og:image:height' => $height,
'og:image:alt' => $title,
'og:url' => $url,
'og:site_name' => GetConfig('StoreName')
);
if (GetConfig('FacebookLikeButtonAdminIds')) {
$tags['fb:admins'] = GetConfig('FacebookLikeButtonAdminIds');
}
$metaTagsHTML = '';
foreach ($tags as $propertyName => $tagContent) {
$metaTagsHTML .= '<meta property="' . $propertyName . '" content="' . htmlspecialchars($tagContent,'ENT_IGNORE','UTF-8') . '" />' . "\n";
}
return $metaTagsHTML;
}
}