1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Minor parsing issue corrected. Debug info removed from newspost 'update'.

This commit is contained in:
Cameron
2015-04-12 19:45:55 -07:00
parent c7675f616a
commit 2f46c967da
2 changed files with 20 additions and 8 deletions

View File

@@ -468,7 +468,7 @@ class news_admin_ui extends e_admin_ui
public function afterUpdate($new_data, $old_data, $id) public function afterUpdate($new_data, $old_data, $id)
{ {
$this->processPings(); $this->processPings();
e107::getMessage()->addInfo(print_a($new_data,true));
e107::getEvent()->trigger('newsupd', $new_data); e107::getEvent()->trigger('newsupd', $new_data);
e107::getEvent()->trigger('admin_news_updated',$new_data); e107::getEvent()->trigger('admin_news_updated',$new_data);

View File

@@ -506,7 +506,7 @@ class e_parse extends e_parser
if (MAGIC_QUOTES_GPC == TRUE && $nostrip == FALSE) if (MAGIC_QUOTES_GPC == true && $nostrip == false)
{ {
$data = stripslashes($data); $data = stripslashes($data);
} }
@@ -524,10 +524,10 @@ class e_parse extends e_parser
$data = urldecode($data); // symptom of cleaning the HTML - urlencodes src attributes containing { and } .eg. {e_BASE} $data = urldecode($data); // symptom of cleaning the HTML - urlencodes src attributes containing { and } .eg. {e_BASE}
} }
else else // caused double-encoding of '&'
{ {
$data = str_replace('<','&lt;',$data); //$data = str_replace('<','&lt;',$data);
$data = str_replace('>','&gt;',$data); //$data = str_replace('>','&gt;',$data);
} }
if (!check_class($core_pref->get('post_html', e_UC_MAINADMIN))) if (!check_class($core_pref->get('post_html', e_UC_MAINADMIN)))
@@ -552,9 +552,6 @@ class e_parse extends e_parser
} }
//TODO Determine if the code below is still useful.
if ($no_encode === TRUE && strpos($mod, 'no_html') === FALSE) if ($no_encode === TRUE && strpos($mod, 'no_html') === FALSE)
{ {
$search = array('$', '"', "'", '\\', '<?'); $search = array('$', '"', "'", '\\', '<?');
@@ -563,9 +560,11 @@ class e_parse extends e_parser
} }
else else
{ {
$data = htmlspecialchars($data, ENT_QUOTES, 'UTF-8'); $data = htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
$data = str_replace('\\', '&#092;', $data); $data = str_replace('\\', '&#092;', $data);
$ret = preg_replace("/&amp;#(\d*?);/", "&#\\1;", $data); $ret = preg_replace("/&amp;#(\d*?);/", "&#\\1;", $data);
} }
@@ -3306,6 +3305,19 @@ TMPL;
print_a($dbText); print_a($dbText);
if(!empty($advanced))
{
echo "<div class='alert alert-warning'>";
$dbText2 = $tp->toDB($text, true, false, 'no_html');
echo "<h3>User-input &gg; toDb(\$text, true, false, 'no_html')</h3>";
print_a($dbText2);
echo "</div>";
}
echo "<h3>toDB() &gg; toHtml()</h3>"; echo "<h3>toDB() &gg; toHtml()</h3>";
$html = $tp->toHtml($dbText,true); $html = $tp->toHtml($dbText,true);
print_a($html); print_a($html);