Răsfoiți Sursa

Fix handling of authors with ampersand & (#4287)

Especially needed for HTML+XPath Web scraping as it makes the rest of the pipeline fail to handle special characters.
Alexandre Alapetite 4 ani în urmă
părinte
comite
92b0ffe05c
2 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 2 0
      app/Models/Entry.php
  2. 1 0
      lib/lib_rss.php

+ 2 - 0
app/Models/Entry.php

@@ -271,7 +271,9 @@ class FreshRSS_Entry extends Minz_Model {
 		$this->hash = '';
 		$this->hash = '';
 		if (!is_array($value)) {
 		if (!is_array($value)) {
 			if (strpos($value, ';') !== false) {
 			if (strpos($value, ';') !== false) {
+				$value = htmlspecialchars_decode($value, ENT_QUOTES);
 				$value = preg_split('/\s*[;]\s*/', $value, -1, PREG_SPLIT_NO_EMPTY);
 				$value = preg_split('/\s*[;]\s*/', $value, -1, PREG_SPLIT_NO_EMPTY);
+				$value = Minz_Helper::htmlspecialchars_utf8($value);
 			} else {
 			} else {
 				$value = preg_split('/\s*[,]\s*/', $value, -1, PREG_SPLIT_NO_EMPTY);
 				$value = preg_split('/\s*[,]\s*/', $value, -1, PREG_SPLIT_NO_EMPTY);
 			}
 			}

+ 1 - 0
lib/lib_rss.php

@@ -196,6 +196,7 @@ function timestamptodate ($t, $hour = true) {
 }
 }
 
 
 /**
 /**
+ * Decode HTML entities but preserve XML entities.
  * @param string|null $text
  * @param string|null $text
  */
  */
 function html_only_entity_decode($text): string {
 function html_only_entity_decode($text): string {