Added parameters to html_entity_decode() and htmlentities().

I did not use the wrapper method for those few occurences since it was too much work.
I'm sorry :-D
This commit is contained in:
Garvin Hicking 2014-11-29 12:18:56 +01:00
parent b15313c30c
commit 5731762a34
40 changed files with 79 additions and 90 deletions

View file

@ -21,17 +21,6 @@ if (file_exists($probelang)) {
include dirname(__FILE__) . '/lang_en.inc.php';
if (!function_exists('html_entity_decode')) {
function html_entity_decode($given_html, $quote_style = ENT_QUOTES) {
$trans_table = get_html_translation_table(HTML_SPECIALCHARS, $quote_style);
if ($trans_table["'"] != ''') { # some versions of PHP match single quotes to '
$trans_table["'"] = ''';
}
return (strtr($given_html, array_flip($trans_table)));
}
}
class serendipity_event_blogpdf extends serendipity_event
{
var $title = PLUGIN_EVENT_BLOGPDF_NAME;
@ -340,9 +329,9 @@ class serendipity_event_blogpdf extends serendipity_event
if (serendipity_db_bool($this->get_config('html2pdf'))) {
return $string;
} elseif (serendipity_db_bool($this->get_config('fallback'))) {
return strip_tags(html_entity_decode(utf8_decode($string)));
return strip_tags(html_entity_decode(utf8_decode($string), ENT_COMPAT, LANG_CHARSET));
} else {
return strip_tags(html_entity_decode($string));
return strip_tags(html_entity_decode($string, ENT_COMPAT, LANG_CHARSET));
}
}

View file

@ -166,7 +166,7 @@ class serendipity_event_custom_permalinks extends serendipity_event {
<fieldset style="margin: 5px">
<legend><?php echo PLUGIN_EVENT_CUSTOM_PERMALINKS_PL; ?></legend>
<div><?php echo PLUGIN_EVENT_CUSTOM_PERMALINKS_PL_DESC; ?><br /><br /></div>
<label for="permalink" title="<?php echo htmlentities(PLUGIN_EVENT_CUSTOM_PERMALINKS_PL); ?>"><?php echo PLUGIN_EVENT_CUSTOM_PERMALINKS_PL; ?>:</label> <input class="input_textbox" type="text" style="width: 60%" name="serendipity[permalink]" id="permalink" value="<?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($permalink) : htmlspecialchars($permalink, ENT_COMPAT, LANG_CHARSET)); ?>" />
<label for="permalink" title="<?php echo htmlentities(PLUGIN_EVENT_CUSTOM_PERMALINKS_PL, ENT_COMPAT, LANG_CHARSET); ?>"><?php echo PLUGIN_EVENT_CUSTOM_PERMALINKS_PL; ?>:</label> <input class="input_textbox" type="text" style="width: 60%" name="serendipity[permalink]" id="permalink" value="<?php echo (function_exists('serendipity_specialchars') ? serendipity_specialchars($permalink) : htmlspecialchars($permalink, ENT_COMPAT, LANG_CHARSET)); ?>" />
</fieldset>
<?php
return true;

View file

@ -778,7 +778,7 @@ class serendipity_event_gravatar extends serendipity_event
{
// Attempt to grab an avatar link from their webpage url
$linkUrl = html_entity_decode($matches[1]);
$linkUrl = html_entity_decode($matches[1], ENT_COMPAT, LANG_CHARSET);
if (substr($linkUrl, 0, 1) == '/') {
if ($urlParts = parse_url($url)) {
$faviconURL = $urlParts['scheme'] . '://' . $urlParts['host'] . $linkUrl;

View file

@ -242,7 +242,7 @@ class serendipity_event_ljupdate extends serendipity_event
$v = $res->value()->getval();
$newitemid = (int)$v['itemid'];
} else {
echo htmlentities($res->faultString()).'<br />';
echo htmlentities($res->faultString(), ENT_COMPAT, LANG_CHARSET).'<br />';
$newitemid = 0;
}
@ -374,7 +374,7 @@ class serendipity_event_ljupdate extends serendipity_event
curl_close ($ch);
echo "URL open finished. Output:<br /><br /><hr />\n\n";
echo htmlentities($result) . "\n\n<hr /><br />\n\n";
echo htmlentities($result, ENT_COMPAT, LANG_CHARSET) . "\n\n<hr /><br />\n\n";
$post_url = 'http://blog.myspace.com/index.cfm?fuseaction=blog.processCreate';
$post_params = "postMonth=$month&postDay=$day&postYear=$year&postHour=$hour&postMinute=$minute&postTimeMarker=$marker&subject=$subject&body=$content";
@ -393,7 +393,7 @@ class serendipity_event_ljupdate extends serendipity_event
$result=curl_exec ($ch);
curl_close ($ch);
echo "URL open finished. Output:<br /><br /><hr />\n\n";
echo htmlentities($result) . "\n\n<hr /><br />\n\n";
echo htmlentities($result, ENT_COMPAT, LANG_CHARSET) . "\n\n<hr /><br />\n\n";
unlink($tmp_cookie_file);

View file

@ -31,7 +31,7 @@ class serendipity_event_markdown extends serendipity_event
'smarty' => '2.6.7',
'php' => '5.3.0'
));
$propbag->add('version', '1.21');
$propbag->add('version', '1.22');
$propbag->add('cachable_events', array('frontend_display' => true));
$propbag->add('event_hooks', array('frontend_display' => true, 'frontend_comment' => true));
$propbag->add('groups', array('MARKUP'));
@ -211,7 +211,7 @@ class serendipity_event_markdown extends serendipity_event
if (isset($GLOBALS['entry'][0]['plaintext_body'])) {
$html = ($version == 2) ? Markdown::defaultTransform($GLOBALS['entry'][0]['plaintext_body']) : Markdown($GLOBALS['entry'][0]['plaintext_body']);
} else {
$html = ($version == 2) ? Markdown::defaultTransform(html_entity_decode($eventData['body'])) : Markdown(html_entity_decode($eventData['body']));
$html = ($version == 2) ? Markdown::defaultTransform(html_entity_decode($eventData['body'], ENT_COMPAT, LANG_CHARSET)) : Markdown(html_entity_decode($eventData['body'], ENT_COMPAT, LANG_CHARSET));
}
if ($pants > 0) $html = ($pants == 2) ? SmartyPantsTypographer::defaultTransform($html) : SmartyPants::defaultTransform($html);
$GLOBALS['entry'][0]['plaintext_body'] = trim(strip_tags(str_replace('javascript:', '', $html)));

View file

@ -190,8 +190,8 @@ class serendipity_plugin_microformats extends serendipity_plugin
$dtstart = str_replace('T', ' ', $v['DTSTART']);
$v['DTSTART'] .= $this->get_config('timezone');
echo '<div class="vevent" style="margin-bottom:1em;">';
echo '<p class="summary" style="font-weight:bold;margin:0;padding:0;color:#DDD">' . htmlentities($v['SUMMARY']) . '</p>';
echo '<p style="margin:0;padding:0 0 0 18px;background:url(' . $serendipity['baseURL'] . 'plugins/serendipity_event_microformats/img/house_12.png) 0 0 no-repeat;"><a href="' . $v['URL'] . '" class="url location" style="color:#70191B;">' . htmlentities($v['LOCATION']) . '</a></p>';
echo '<p class="summary" style="font-weight:bold;margin:0;padding:0;color:#DDD">' . htmlentities($v['SUMMARY'], ENT_COMPAT, LANG_CHARSET) . '</p>';
echo '<p style="margin:0;padding:0 0 0 18px;background:url(' . $serendipity['baseURL'] . 'plugins/serendipity_event_microformats/img/house_12.png) 0 0 no-repeat;"><a href="' . $v['URL'] . '" class="url location" style="color:#70191B;">' . htmlentities($v['LOCATION'], ENT_COMPAT, LANG_CHARSET) . '</a></p>';
echo '<p style="margin:0;padding:0 0 0 18px;background:url(' . $serendipity['baseURL'] . 'plugins/serendipity_event_microformats/img/clock_12.png) 0 0 no-repeat;"><abbr class="dtstart" title="' . $v['DTSTART'] . '" style="color:#70191B;">' . date('d.m.Y, H:i', strtotime($dtstart)) . ' Uhr</abbr><!-- &mdash; <abbr class="dtend" title="' . $v['DTEND'] . '">' . date('d.m.Y H:i', strtotime($v['DTEND'])) . ' Uhr</abbr>--></p>';
/* LATER if (isset($v['DESC'])) {
echo '<p class="description" style="margin:0 0 0 3px;padding:0;">' . $v['DESC'] . '</p>';

View file

@ -123,7 +123,7 @@ echo '</pre>';*/
'hreview_url' => $params['url'],
'hreview_name' => $params['name'],
'hreview_desc' => $params['desc'],
'hreview_desc_escaped' => htmlentities($params['desc']),
'hreview_desc_escaped' => htmlentities($params['desc'], ENT_COMPAT, LANG_CHARSET),
'hreview_rating' => floor($params['rating']),
'hreview_ratingvalue' => $params['rating'],
'hreview_best' => (int)$serendipity['smarty']->_tpl_vars['best']/*,
@ -152,7 +152,7 @@ echo '</pre>';*/
'hcalendar_startdate_humanreadable' => date('d.m.Y H:i T', $params['startdate']),
'hcalendar_enddate_humanreadable' => date('d.m.Y H:i T', $params['enddate']),
'hcalendar_desc' => $params['desc'],
'hcalendar_desc_escaped' => htmlentities($params['desc'])
'hcalendar_desc_escaped' => htmlentities($params['desc'], ENT_COMPAT, LANG_CHARSET)
)
);
break;

View file

@ -24,7 +24,7 @@ class serendipity_event_mimetex extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_MIMETEX_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Matthew Groeninger');
$propbag->add('version', '1.3');
$propbag->add('version', '1.4');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -235,7 +235,7 @@ class serendipity_event_mimetex extends serendipity_event
break;
case 'mimetex.php':
$q = html_entity_decode(rawurldecode($_REQUEST['q']));
$q = html_entity_decode(rawurldecode($_REQUEST['q']), ENT_COMPAT, LANG_CHARSET);
$filetype = $this->get_config('filetype','gif');
if (!empty($q)) {
$filename = md5($q);

View file

@ -239,7 +239,7 @@ class serendipity_event_mymood extends serendipity_event {
$img_tag = (!empty($mood_info['mood_img'])) ?
'<img class="mymood_img" alt="' . $mood_info['mood_name'] . '" src="' . $mood_info['mood_img'] . '">' :
'';
$ascii = (!empty($mood_info['mood_ascii'])) ? htmlentities($mood_info['mood_ascii']) : '';
$ascii = (!empty($mood_info['mood_ascii'])) ? htmlentities($mood_info['mood_ascii'], ENT_COMPAT, LANG_CHARSET) : '';
$format=str_replace(array('{img}', '{name}', '{ascii}'),
array($img_tag, $mood_info['mood_name'], $ascii),

View file

@ -25,7 +25,7 @@ class serendipity_event_phoneblogz extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_PHONEBLOGZ_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking, phoneblogz.com');
$propbag->add('version', '0.8');
$propbag->add('version', '0.9');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',

View file

@ -1449,7 +1449,7 @@
if($this->debug)
{
//by maHo, replaced htmlspecialchars with htmlentities
print "<PRE>---GOT---\n" . htmlentities($data) . "\n---END---\n</PRE>";
print "<PRE>---GOT---\n" . htmlentities($data, ENT_COMPAT, LANG_CHARSET) . "\n---END---\n</PRE>";
}
if($data == '')

View file

@ -602,7 +602,7 @@ class serendipity_event_picasa extends serendipity_event {
if(!$subdirOfPruned)
{
$splitPath = explode('/', $relpath);
$encodedRelpath = htmlentities($relpath, ENT_QUOTES);
$encodedRelpath = htmlentities($relpath, ENT_QUOTES, LANG_CHARSET);
$prefix = str_repeat('&nbsp;&nbsp;', count($splitPath));
echo "<option value='$encodedRelpath'>$prefix $name</option>\n";
}
@ -647,7 +647,7 @@ class serendipity_event_picasa extends serendipity_event {
{
// undo encoding, including all quotes, then re-encode without encoding
// the quotes because this the text of the xml tag, which doesn't need quotes
$unescapedvalue = htmlentities(html_entity_decode($tagval, ENT_QUOTES), ENT_NOQUOTES);
$unescapedvalue = htmlentities(html_entity_decode($tagval, ENT_QUOTES, LANG_CHARSET), ENT_NOQUOTES, LANG_CHARSET);
fputs($outputFile, "<$tagname>$unescapedvalue</$tagname>\n");
}
@ -691,9 +691,9 @@ class serendipity_event_picasa extends serendipity_event {
return;
}
$albumName = html_entity_decode($_POST['albumName'], ENT_QUOTES);
$albumName = html_entity_decode($_POST['albumName'], ENT_QUOTES, LANG_CHARSET);
$decodedParentDir = html_entity_decode($_POST['parentDir'], ENT_QUOTES);
$decodedParentDir = html_entity_decode($_POST['parentDir'], ENT_QUOTES, LANG_CHARSET);
$albumDir = $decodedParentDir . $albumName;
$dirname = $this->get_config('picasapath') . '/' . $albumDir;
@ -769,7 +769,7 @@ class serendipity_event_picasa extends serendipity_event {
}
$imageCount = count($entries);
$albumDesc = html_entity_decode($_POST['albumDescription'], ENT_QUOTES);
$albumDesc = html_entity_decode($_POST['albumDescription'], ENT_QUOTES, LANG_CHARSET);
$xmlPath = "$dirname/index.xml";
$xmlFile = fopen($xmlPath, 'w+');

View file

@ -27,7 +27,7 @@ class getid3_lib
}
}
if ($htmlsafe) {
$returnstring = htmlentities($returnstring);
$returnstring = htmlentities($returnstring, ENT_COMPAT, LANG_CHARSET);
}
return $returnstring;
}
@ -999,7 +999,7 @@ class getid3_lib
$charval += (ord($string{++$i}) & 0x3F);
}
if (($charval >= 32) && ($charval <= 127)) {
$HTMLstring .= htmlentities(chr($charval));
$HTMLstring .= htmlentities(chr($charval), ENT_COMPAT, LANG_CHARSET);
} else {
$HTMLstring .= '&#'.$charval.';';
}

View file

@ -100,7 +100,7 @@ class Image_XMP
if (!$filehnd)
{
// Could't open the file - exit
echo '<p>Could not open file '.htmlentities($filename).'</p>'."\n";
echo '<p>Could not open file '.htmlentities($filename, ENT_COMPAT, LANG_CHARSET).'</p>'."\n";
return false;
}

View file

@ -256,7 +256,7 @@ class getid3_writetags
if (($ape_writer->tag_data = $this->FormatDataForAPE()) !== false) {
$ape_writer->filename = $this->filename;
if (($success = $ape_writer->WriteAPEtag()) === false) {
$this->errors[] = 'WriteAPEtag() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $ape_writer->errors)))).'</li></ul></pre>';
$this->errors[] = 'WriteAPEtag() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $ape_writer->errors)), ENT_COMPAT, LANG_CHARSET)).'</li></ul></pre>';
}
} else {
$this->errors[] = 'FormatDataForAPE() failed';
@ -268,7 +268,7 @@ class getid3_writetags
if (($id3v1_writer->tag_data = $this->FormatDataForID3v1()) !== false) {
$id3v1_writer->filename = $this->filename;
if (($success = $id3v1_writer->WriteID3v1()) === false) {
$this->errors[] = 'WriteID3v1() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $id3v1_writer->errors)))).'</li></ul></pre>';
$this->errors[] = 'WriteID3v1() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $id3v1_writer->errors)), ENT_COMPAT, LANG_CHARSET)).'</li></ul></pre>';
}
} else {
$this->errors[] = 'FormatDataForID3v1() failed';
@ -284,7 +284,7 @@ class getid3_writetags
if (($id3v2_writer->tag_data = $this->FormatDataForID3v2($id3v2_writer->majorversion)) !== false) {
$id3v2_writer->filename = $this->filename;
if (($success = $id3v2_writer->WriteID3v2()) === false) {
$this->errors[] = 'WriteID3v2() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $id3v2_writer->errors)))).'</li></ul></pre>';
$this->errors[] = 'WriteID3v2() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $id3v2_writer->errors)), ENT_COMPAT, LANG_CHARSET)).'</li></ul></pre>';
}
} else {
$this->errors[] = 'FormatDataForID3v2() failed';
@ -296,7 +296,7 @@ class getid3_writetags
if (($vorbiscomment_writer->tag_data = $this->FormatDataForVorbisComment()) !== false) {
$vorbiscomment_writer->filename = $this->filename;
if (($success = $vorbiscomment_writer->WriteVorbisComment()) === false) {
$this->errors[] = 'WriteVorbisComment() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $vorbiscomment_writer->errors)))).'</li></ul></pre>';
$this->errors[] = 'WriteVorbisComment() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $vorbiscomment_writer->errors)), ENT_COMPAT, LANG_CHARSET)).'</li></ul></pre>';
}
} else {
$this->errors[] = 'FormatDataForVorbisComment() failed';
@ -308,7 +308,7 @@ class getid3_writetags
if (($metaflac_writer->tag_data = $this->FormatDataForMetaFLAC()) !== false) {
$metaflac_writer->filename = $this->filename;
if (($success = $metaflac_writer->WriteMetaFLAC()) === false) {
$this->errors[] = 'WriteMetaFLAC() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $metaflac_writer->errors)))).'</li></ul></pre>';
$this->errors[] = 'WriteMetaFLAC() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $metaflac_writer->errors)), ENT_COMPAT, LANG_CHARSET)).'</li></ul></pre>';
}
} else {
$this->errors[] = 'FormatDataForMetaFLAC() failed';
@ -320,7 +320,7 @@ class getid3_writetags
if (($real_writer->tag_data = $this->FormatDataForReal()) !== false) {
$real_writer->filename = $this->filename;
if (($success = $real_writer->WriteReal()) === false) {
$this->errors[] = 'WriteReal() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $real_writer->errors)))).'</li></ul></pre>';
$this->errors[] = 'WriteReal() failed with message(s):<pre><ul><li>'.str_replace("\n", '</li><li>', htmlentities(trim(implode("\n", $real_writer->errors)), ENT_COMPAT, LANG_CHARSET)).'</li></ul></pre>';
}
} else {
$this->errors[] = 'FormatDataForReal() failed';

View file

@ -177,7 +177,7 @@ function sprintpcs_pictureshare($maildir, $body, $authorid) {
$picture=substr($body, 0, $pos1-1);
$pos1=strrpos($picture, '"');
$url=substr($picture, $pos1+1);
$url=html_entity_decode($url);
$url=html_entity_decode($url, ENT_COMPAT, LANG_CHARSET);
// Fetch the picture
$targeturl=sprintpcs_getrealpicture($url);
@ -227,7 +227,7 @@ function sprintpcs_pictureshare($maildir, $body, $authorid) {
$msg=stristr($body, SPRINTPCS_MSG);
if ($msg) {
$pos=strpos($msg, '</font>');
$msg=html_entity_decode(substr($msg, 17, $pos-17), ENT_QUOTES).'<br /><br />';
$msg=html_entity_decode(substr($msg, 17, $pos-17), ENT_QUOTES, LANG_CHARSET).'<br /><br />';
if (trim($msg) == '<br /><br />') $msg='';
} else {
$msg='';
@ -239,7 +239,7 @@ function sprintpcs_pictureshare($maildir, $body, $authorid) {
$memo=stristr($memo, SPRINTPCS_MEMO_START);
$pos=strpos($memo, '"');
$memo=substr($memo, 0, $pos);
$memo=html_entity_decode($memo);
$memo=html_entity_decode($memo, ENT_COMPAT, LANG_CHARSET);
$memosound = @file_get_contents($memo);
// Build the filename - I use this funky date name because the Sprint file path is too gnarly
$memofilename = date("F_j_Y__H_i_s").'.wav';
@ -287,7 +287,7 @@ function sprintpcs_videoshare($maildir, $body, $authorid) {
}
$pos=strpos($video, '"');
$url=substr($video, 0, $pos);
$url=html_entity_decode($url);
$url=html_entity_decode($url, ENT_COMPAT, LANG_CHARSET);
// Fetch the picture
$videostill = @file_get_contents($url);
@ -364,12 +364,12 @@ function sprintpcs_videoshare($maildir, $body, $authorid) {
$msg=strstr($body, SPRINTPCS_MSG);
if ($msg) {
$pos=strpos($msg, '</font>');
$msg=html_entity_decode(substr($msg, 17, $pos-17), ENT_QUOTES).'<br /><br />';
$msg=html_entity_decode(substr($msg, 17, $pos-17), ENT_QUOTES, LANG_CHARSET).'<br /><br />';
if (trim($msg) == '<br /><br />') $msg='';
} elseif ($msg=stristr($body, SPRINTPCS_VID_MSG)) {
$msg=strstr($msg, '"2">');
$pos=strpos($msg, '</font');
$msg=html_entity_decode(substr($msg, 4, $pos-4), ENT_QUOTES).'<br /><br />';
$msg=html_entity_decode(substr($msg, 4, $pos-4), ENT_QUOTES, LANG_CHARSET).'<br /><br />';
if (trim($msg) == '<br /><br />') $msg='';
} else {
$msg='';
@ -381,7 +381,7 @@ function sprintpcs_videoshare($maildir, $body, $authorid) {
$memo=stristr($memo, SPRINTPCS_MEMO_START);
$pos=strpos($memo, '"');
$memo=substr($memo, 0, $pos);
$memo=html_entity_decode($memo);
$memo=html_entity_decode($memo, ENT_COMPAT, LANG_CHARSET);
$memosound = @file_get_contents($memo);
// Build the filename - I use this funky date name because the Sprint file path is too gnarly
$memofilename = date("F_j_Y__H_i_s").'.wav';
@ -429,7 +429,7 @@ function sprintpcs_albumshare($maildir, $body, $authorid) {
}
$pos=strpos($video, '"');
$url=substr($video, 0, $pos);
$url=html_entity_decode($url);
$url=html_entity_decode($url, ENT_COMPAT, LANG_CHARSET);
// Fetch the picture
$videostill = @file_get_contents($url);
@ -506,12 +506,12 @@ function sprintpcs_albumshare($maildir, $body, $authorid) {
$msg=strstr($body, SPRINTPCS_MSG);
if ($msg) {
$pos=strpos($msg, '</font>');
$msg=html_entity_decode(substr($msg, 17, $pos-17), ENT_QUOTES).'<br /><br />';
$msg=html_entity_decode(substr($msg, 17, $pos-17), ENT_QUOTES, LANG_CHARSET).'<br /><br />';
if (trim($msg) == '<br /><br />') $msg='';
} elseif ($msg=stristr($body, SPRINTPCS_VID_MSG)) {
$msg=strstr($msg, '"2">');
$pos=strpos($msg, '</font');
$msg=html_entity_decode(substr($msg, 4, $pos-4), ENT_QUOTES).'<br /><br />';
$msg=html_entity_decode(substr($msg, 4, $pos-4), ENT_QUOTES, LANG_CHARSET).'<br /><br />';
if (trim($msg) == '<br /><br />') $msg='';
} else {
$msg='';
@ -523,7 +523,7 @@ function sprintpcs_albumshare($maildir, $body, $authorid) {
$memo=stristr($memo, SPRINTPCS_MEMO_START);
$pos=strpos($memo, '"');
$memo=substr($memo, 0, $pos);
$memo=html_entity_decode($memo);
$memo=html_entity_decode($memo, ENT_COMPAT, LANG_CHARSET);
$memosound = @file_get_contents($memo);
// Build the filename - I use this funky date name because the Sprint file path is too gnarly
$memofilename = date("F_j_Y__H_i_s").'.wav';

View file

@ -269,8 +269,8 @@ function recaptcha_mailhide_html($pubkey, $privkey, $email) {
$emailparts = _recaptcha_mailhide_email_parts ($email);
$url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
"' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
return htmlentities($emailparts[0], ENT_COMPAT, LANG_CHARSET) . "<a href='" . htmlentities ($url, ENT_COMPAT, LANG_CHARSET) .
"' onclick=\"window.open('" . htmlentities ($url, ENT_COMPAT, LANG_CHARSET) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1], ENT_COMPAT, LANG_CHARSET);
}

View file

@ -39,7 +39,7 @@ var $error=null;
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('version', '0.10');
$propbag->add('version', '0.11');
$propbag->add('event_hooks', array(
'frontend_configure' => true,
'frontend_saveComment' => true,

View file

@ -159,7 +159,7 @@ class serendipity_event_textlinkads extends serendipity_event
function html_entity_decode($string) {
if (function_exists('html_entity_decode')) {
return html_entity_decode($string);
return html_entity_decode($string, ENT_COMPAT, LANG_CHARSET);
}
// replace numeric entities
@ -181,7 +181,7 @@ class serendipity_event_textlinkads extends serendipity_event
$n = 0;
while (isset($out[$n])) {
$retarr[$out[$n][1]][] = str_replace($search_ar, $replace_ar, $this->html_entity_decode(strip_tags($out[$n][0])));
$retarr[$out[$n][1]][] = str_replace($search_ar, $replace_ar, $this->html_entity_decode(strip_tags($out[$n][0]), ENT_COMPAT, LANG_CHARSET));
$n++;
}

View file

@ -215,7 +215,7 @@ function Interpret_IPTC_to_HTML( $IPTC_info )
if ( $Record_Name == "" )
{
// Record is an unknown field - add message to HTML
$output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">Unknown IPTC field '". htmlentities( $IPTC_Record['IPTC_Type'] ). "' :</td><td class=\"IPTC_Value_Cell\">" . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
$output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">Unknown IPTC field '". htmlentities( $IPTC_Record['IPTC_Type'], ENT_COMPAT, LANG_CHARSET ). "' :</td><td class=\"IPTC_Value_Cell\">" . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
}
else
{

View file

@ -776,7 +776,7 @@ function Generate_JPEG_APP_Segment_HTML( $jpeg_header_data )
// Clean the segment name so it doesn't cause problems with HTML
$seg_name = htmlentities( $seg_name );
$seg_name = htmlentities( $seg_name, ENT_COMPAT, LANG_CHARSET );
// Output a Table row containing this APP segment
$output .= "<tr class=\"JPEG_APP_Segments_Table_Row\"><td class=\"JPEG_APP_Segments_Caption_Cell\">$seg_name</td><td class=\"JPEG_APP_Segments_Type_Cell\">" . $jpeg_header['SegName'] . "</td><td class=\"JPEG_APP_Segments_Size_Cell\" align=\"right\">" . strlen( $jpeg_header['SegData']). " bytes</td></tr>\n";

View file

@ -445,7 +445,7 @@ function Interpret_IRB_to_HTML( $IRB_array, $filename )
break;
case 0x040B : // URL
$output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">$Resource_Name</td><td class=\"Photoshop_Value_Cell\"><a href=\"" . $IRB_Resource['ResData'] . "\">" . htmlentities( $IRB_Resource['ResData'] ) ."</a></td></tr>\n";
$output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">$Resource_Name</td><td class=\"Photoshop_Value_Cell\"><a href=\"" . $IRB_Resource['ResData'] . "\">" . htmlentities( $IRB_Resource['ResData'], ENT_COMPAT, LANG_CHARSET ) ."</a></td></tr>\n";
break;
case 0x040A : // Copyright Marked

View file

@ -24,7 +24,7 @@ class serendipity_event_usergallery extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_USERGALLERY_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'Arnan de Gans, Matthew Groeninger, and Stefan Willoughby');
$propbag->add('version', '2.58');
$propbag->add('version', '2.59');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',

View file

@ -28,7 +28,7 @@ class serendipity_event_yq extends serendipity_event {
$propbag->add('description', PLUGIN_EVENT_YQ_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Rasmus Lerdorf');
$propbag->add('version', '1.2');
$propbag->add('version', '1.3');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -74,7 +74,7 @@ class serendipity_event_yq extends serendipity_event {
$hooks = &$bag->get('event_hooks');
$results = $this->get_config('results');
$context_length = $this->get_config('context_length');
$add_context = htmlentities($this->get_config('add_context'));
$add_context = htmlentities($this->get_config('add_context'), ENT_COMPAT, LANG_CHARSET);
$links = array();
if (isset($hooks[$event])) {
@ -84,7 +84,7 @@ class serendipity_event_yq extends serendipity_event {
break;
case 'frontend_display:html:per_entry':
$title = htmlentities($eventData['title']);
$title = htmlentities($eventData['title'], ENT_COMPAT, LANG_CHARSET);
$tmp = strip_tags($eventData['body']);
$tmp = wordwrap($tmp, 80, '<>');
$tmp = explode('<>', $tmp);

View file

@ -192,6 +192,6 @@ class serendipity_plugin_delicious extends serendipity_plugin {
}
function delicious_clean_htmlspecialchars($given, $quote_style = ENT_QUOTES) {
return htmlspecialchars(html_entity_decode($given, $quote_style), $quote_style);
return htmlspecialchars(html_entity_decode($given, $quote_style, LANG_CHARSET), $quote_style, LANG_CHARSET);
}
?>

View file

@ -276,7 +276,7 @@ class DB_storage extends PEAR
{
foreach ($this->_properties as $prop => $foo) {
print "$prop = ";
print htmlentities($this->$prop);
print htmlentities($this->$prop, ENT_COMPAT, LANG_CHARSET);
print "<br />\n";
}
}

View file

@ -28,7 +28,7 @@ class serendipity_plugin_flickr extends serendipity_plugin {
'smarty' => '2.6.9',
'php' => '4.3.0'
));
$propbag->add('version', '1.08');
$propbag->add('version', '1.09');
$propbag->add('configuration', array(
'title',
'email',

View file

@ -7,7 +7,7 @@
*
* @author Lars Strojny <lars@strojny.net>
*/
@define('SERENDIPITY_PLUGIN_FLICKRBADGE_VERSION', '0.10');
@define('SERENDIPITY_PLUGIN_FLICKRBADGE_VERSION', '0.11');
if (IN_SERENDIPITY != true) die("Don't hack");

View file

@ -23,7 +23,7 @@ class serendipity_plugin_nugget_multilingual extends serendipity_plugin {
$propbag->add('description', PLUGIN_NUGGET_MULTI_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'Wesley Hwang-Chung');
$propbag->add('version', '1.6');
$propbag->add('version', '1.7');
$propbag->add('configuration', array('language', 'title', 'content', 'markup', 'show_where'));
$propbag->add('groups', array('FRONTEND_VIEWS'));
@ -131,7 +131,7 @@ class serendipity_plugin_nugget_multilingual extends serendipity_plugin {
$is_plugin_owner = ($this->serendipity_owner == $serendipity['authorid'] || serendipity_checkPermission('adminPluginsMaintainOthers'));
if ($is_plugin_owner) {
echo '<div class="serendipity_edit_nugget"><a href="' . $serendipity['baseURL'] . '/serendipity_admin.php?serendipity[adminModule]=plugins&amp;serendipity[plugin_to_conf]=' . htmlentities($this->instance) . '">' . EDIT . '</a></div>';
echo '<div class="serendipity_edit_nugget"><a href="' . $serendipity['baseURL'] . '/serendipity_admin.php?serendipity[adminModule]=plugins&amp;serendipity[plugin_to_conf]=' . htmlentities($this->instance, ENT_COMPAT, LANG_CHARSET) . '">' . EDIT . '</a></div>';
}
}
}

View file

@ -280,7 +280,7 @@ class serendipity_plugin_socialbookmarks extends serendipity_plugin {
if ($this->get_config('displayThumbnails')) {
$socialbookmarksContent .= $this->socialbookmarks_get_thumbnail($item->get_description());
} else {
$socialbookmarksContent .= html_entity_decode($this->decode($item->get_title()));
$socialbookmarksContent .= html_entity_decode($this->decode($item->get_title()), ENT_COMPAT, LANG_CHARSET);
}
$socialbookmarksContent .= '</a>';
if ($this->get_config('displayTags') && class_exists('serendipity_event_freetag')) { // display tags for each bookmark

View file

@ -229,7 +229,7 @@ class Twitter {
function parse_entry_json( $item ) {
$entry = array();
if (preg_match('/href="([^"]*)"/',html_entity_decode($item->source),$matches)) {
if (preg_match('/href="([^"]*)"/',html_entity_decode($item->source, ENT_COMPAT, LANG_CHARSET),$matches)) {
$source_link = $matches[1][0];
}
//$link = str_replace('<a href="','',str_replace('"/a>','',html_entity_decode($item['source'])));

View file

@ -105,7 +105,7 @@ class TwitterOAuthApi {
static function parse_entry_json( $item ) {
$entry = array();
if (preg_match('/href="([^"]*)"/',html_entity_decode($item->source),$matches)) {
if (preg_match('/href="([^"]*)"/',html_entity_decode($item->source, ENT_COMPAT, LANG_CHARSET),$matches)) {
$source_link = $matches[1][0];
}
//$link = str_replace('<a href="','',str_replace('"/a>','',html_entity_decode($item['source'])));

View file

@ -1,4 +1,4 @@
<?php
// Actual version of both plugins
@define('PLUGIN_TWITTER_VERSION', '1.65');
@define('PLUGIN_TWITTER_VERSION', '1.66');

View file

@ -735,7 +735,7 @@ function blogdata_view($blogid = '', $tplid = '') {
$TEMPLATE_DESCRIPTION = $templatedata['description'];
// Template contents
$template_contents = html_entity_decode($templatedata['template']);
$template_contents = html_entity_decode($templatedata['template'], ENT_COMPAT, LANG_CHARSET);
// Expand the template variables recursively
$templatevars = expand_templatevars($templatevars);
@ -751,7 +751,7 @@ function blogdata_view($blogid = '', $tplid = '') {
$template_contents = str_replace('{WWWUSER}', $WWWUSER, $template_contents);
*/
foreach ($templatevars as $tplvar) {
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value']), $template_contents);
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value'], ENT_COMPAT, LANG_CHARSET), $template_contents);
}
// Insert specific blog template variables
@ -773,7 +773,7 @@ function blogdata_view($blogid = '', $tplid = '') {
echo "<br />";
echo "Click <a href=\"tplfile.php?blogid=$blogid&amp;tplid=$tplid\" onmouseover=\"window.status='Click to download template contents';return true\" onmouseout=\"window.status='';return true\">here</a> to download";
echo '<hr /><div class="left">';
echo nl2br(htmlentities($template_contents));
echo nl2br(htmlentities($template_contents, ENT_COMPAT, LANG_CHARSET));
echo "</div><hr />";
echo "Click <a href=\"tplfile.php?blogid=$blogid&amp;tplid=$tplid\" onmouseover=\"window.status='Click to download template contents';return true\" onmouseout=\"window.status='';return true\">here</a> to download";
echo "<br />";
@ -826,7 +826,7 @@ function blogdata_view_all($tplid = '') {
$TEMPLATE_DESCRIPTION = $templatedata['description'];
// Template contents
$template_contents = html_entity_decode($templatedata['template']);
$template_contents = html_entity_decode($templatedata['template'], ENT_COMPAT, LANG_CHARSET);
// Expand the template variables recursively
$templatevars = expand_templatevars($templatevars);
@ -842,7 +842,7 @@ function blogdata_view_all($tplid = '') {
$template_contents = str_replace('{WWWUSER}', $WWWUSER, $template_contents);
*/
foreach ($templatevars as $tplvar) {
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value']), $template_contents);
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value'], ENT_COMPAT, LANG_CHARSET), $template_contents);
}
// Insert specific template template variables
@ -876,7 +876,7 @@ function blogdata_view_all($tplid = '') {
$template_temp = str_replace('{BLOGURL}', $BLOGURL, $template_temp);
echo nl2br(htmlentities($template_temp));
echo nl2br(htmlentities($template_temp, ENT_COMPAT, LANG_CHARSET));
}

View file

@ -96,7 +96,7 @@ debug_msg (\"FILE: \".__FILE__,3);
?>";
debug_msg(nl2br(htmlentities($config_contents)), 5);
debug_msg(nl2br(htmlentities($config_contents, ENT_COMPAT, LANG_CHARSET)), 5);
// Open the file for writing
if (!$file_handle = @fopen($config_file,'wb')) { // Failed to open the file?

View file

@ -128,7 +128,7 @@ define('S9YCONF_DB_PREFIX' , '".$dbcfg_prefix."');
?>";
debug_msg(nl2br(htmlentities($dbconfig_contents)), 5);
debug_msg(nl2br(htmlentities($dbconfig_contents, ENT_COMPAT, LANG_CHARSET)), 5);
// Open the file for writing
if (!$file_handle = @fopen($dbconfig_file,'wb')) { // Failed to open the file?

View file

@ -380,7 +380,7 @@ function template_edit($id) {
$name = $result['name'];
$description=$result['description'];
$template = html_entity_decode($result['template']);
$template = html_entity_decode($result['template'], ENT_COMPAT, LANG_CHARSET);
?>
<div align="center">

View file

@ -386,7 +386,7 @@ function templatevars_edit($id) {
$result = db_read_templatevars($id);
$name = $result['name'];
$value=html_entity_decode($result['value']);
$value=html_entity_decode($result['value'], ENT_COMPAT, LANG_CHARSET);
?>
<div align="center">

View file

@ -126,7 +126,7 @@ $TEMPLATE_DESCRIPTION = $templatedata['description'];
// Template contents
$template_contents = html_entity_decode($templatedata['template']);
$template_contents = html_entity_decode($templatedata['template'], ENT_COMPAT, LANG_CHARSET);
// Expand the template variables recursively
$templatevars = expand_templatevars($templatevars);
@ -142,7 +142,7 @@ $template_contents = str_replace('{WWWGROUP}', $WWWGROUP, $template_contents);
$template_contents = str_replace('{WWWUSER}', $WWWUSER, $template_contents);
*/
foreach ($templatevars as $tplvar) {
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value']), $template_contents);
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value'], ENT_COMPAT, LANG_CHARSET), $template_contents);
}
// Insert specific blog template variables

View file

@ -109,7 +109,7 @@ $TEMPLATE_NAME = $templatedata['name'];
$TEMPLATE_DESCRIPTION = $templatedata['description'];
// Template contents
$template_contents = html_entity_decode($templatedata['template']);
$template_contents = html_entity_decode($templatedata['template'], ENT_COMPAT, LANG_CHARSET);
// Expand the template variables recursively
$templatevars = expand_templatevars($templatevars);
@ -125,7 +125,7 @@ $template_contents = str_replace('{WWWGROUP}', $WWWGROUP, $template_contents);
$template_contents = str_replace('{WWWUSER}', $WWWUSER, $template_contents);
*/
foreach ($templatevars as $tplvar) {
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value']), $template_contents);
$template_contents = str_replace('{'.$tplvar['name'].'}', html_entity_decode($tplvar['value'], ENT_COMPAT, LANG_CHARSET), $template_contents);
}
// Insert specific template template variables