Ticket #54273: 54273.diff
| File 54273.diff, 17.1 KB (added by , 4 years ago) |
|---|
-
src/wp-includes/SimplePie/Cache/MySQL.php
diff --git a/src/wp-includes/SimplePie/Cache/MySQL.php b/src/wp-includes/SimplePie/Cache/MySQL.php index a684eb8334..6ce275b857 100644
a b class SimplePie_Cache_MySQL extends SimplePie_Cache_DB 126 126 $db[] = $row; 127 127 } 128 128 129 if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db ))129 if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db, true)) 130 130 { 131 131 $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'); 132 132 if ($query === false) … … class SimplePie_Cache_MySQL extends SimplePie_Cache_DB 137 137 } 138 138 } 139 139 140 if (!in_array($this->options['extras']['prefix'] . 'items', $db ))140 if (!in_array($this->options['extras']['prefix'] . 'items', $db, true)) 141 141 { 142 142 $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'); 143 143 if ($query === false) -
src/wp-includes/SimplePie/Enclosure.php
diff --git a/src/wp-includes/SimplePie/Enclosure.php b/src/wp-includes/SimplePie/Enclosure.php index 32216d848c..3c6298eebd 100644
a b class SimplePie_Enclosure 1150 1150 } 1151 1151 1152 1152 // If we encounter an unsupported mime-type, check the file extension and guess intelligently. 1153 if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3) ))1153 if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3), true)) 1154 1154 { 1155 1155 switch (strtolower($this->get_extension())) 1156 1156 { … … class SimplePie_Enclosure 1275 1275 1276 1276 if ($find_handler) 1277 1277 { 1278 if (in_array($type, $types_flash ))1278 if (in_array($type, $types_flash, true)) 1279 1279 { 1280 1280 return 'flash'; 1281 1281 } 1282 elseif (in_array($type, $types_fmedia ))1282 elseif (in_array($type, $types_fmedia, true)) 1283 1283 { 1284 1284 return 'fmedia'; 1285 1285 } 1286 elseif (in_array($type, $types_quicktime ))1286 elseif (in_array($type, $types_quicktime, true)) 1287 1287 { 1288 1288 return 'quicktime'; 1289 1289 } 1290 elseif (in_array($type, $types_wmedia ))1290 elseif (in_array($type, $types_wmedia, true)) 1291 1291 { 1292 1292 return 'wmedia'; 1293 1293 } 1294 elseif (in_array($type, $types_mp3 ))1294 elseif (in_array($type, $types_mp3, true)) 1295 1295 { 1296 1296 return 'mp3'; 1297 1297 } -
src/wp-includes/SimplePie/File.php
diff --git a/src/wp-includes/SimplePie/File.php b/src/wp-includes/SimplePie/File.php index 90ad8196a6..c5a442e80d 100644
a b class SimplePie_File 138 138 $this->headers = $parser->headers; 139 139 $this->body = trim($parser->body); 140 140 $this->status_code = $parser->status_code; 141 if ((in_array($this->status_code, array(300, 301, 302, 303, 307) ) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)141 if ((in_array($this->status_code, array(300, 301, 302, 303, 307), true) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) 142 142 { 143 143 $this->redirects++; 144 144 $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); … … class SimplePie_File 223 223 $this->headers = $parser->headers; 224 224 $this->body = $parser->body; 225 225 $this->status_code = $parser->status_code; 226 if ((in_array($this->status_code, array(300, 301, 302, 303, 307) ) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)226 if ((in_array($this->status_code, array(300, 301, 302, 303, 307), true) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects) 227 227 { 228 228 $this->redirects++; 229 229 $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); -
src/wp-includes/SimplePie/Locator.php
diff --git a/src/wp-includes/SimplePie/Locator.php b/src/wp-includes/SimplePie/Locator.php index a207df6fee..7aeeafbea6 100644
a b class SimplePie_Locator 159 159 $mime_types[] = 'text/html'; 160 160 } 161 161 162 return in_array($sniffed, $mime_types );162 return in_array($sniffed, $mime_types, true); 163 163 } 164 164 elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) 165 165 { … … class SimplePie_Locator 244 244 continue; 245 245 } 246 246 247 if (!in_array($href, $done ) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('text/html', 'application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))247 if (!in_array($href, $done, true) && in_array('feed', $rel, true) || (in_array('alternate', $rel, true) && !in_array('stylesheet', $rel, true) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('text/html', 'application/rss+xml', 'application/atom+xml'), true)) && !isset($feeds[$href])) 248 248 { 249 249 $this->checked_feeds++; 250 250 $headers = array( … … class SimplePie_Locator 356 356 return null; 357 357 } 358 358 $rel_values = explode(' ', strtolower($link->getAttribute('rel'))); 359 if (in_array($rel, $rel_values ))359 if (in_array($rel, $rel_values, true)) 360 360 { 361 361 return $href; 362 362 } … … class SimplePie_Locator 373 373 { 374 374 break; 375 375 } 376 if (in_array(strtolower(strrchr($value, '.')), array('.rss', '.rdf', '.atom', '.xml') ))376 if (in_array(strtolower(strrchr($value, '.')), array('.rss', '.rdf', '.atom', '.xml'), true)) 377 377 { 378 378 $this->checked_feeds++; 379 379 -
src/wp-includes/SimplePie/Misc.php
diff --git a/src/wp-includes/SimplePie/Misc.php b/src/wp-includes/SimplePie/Misc.php index a52498ac76..dcfd63a451 100644
a b class SimplePie_Misc 364 364 } 365 365 366 366 // Check that the encoding is supported 367 if (!in_array($input, mb_list_encodings() ))367 if (!in_array($input, mb_list_encodings(), true)) 368 368 { 369 369 return false; 370 370 } … … class SimplePie_Misc 1929 1929 case 'xhtml': 1930 1930 return SIMPLEPIE_CONSTRUCT_XHTML; 1931 1931 } 1932 if (in_array(substr($type, -4), array('+xml', '/xml') ) || substr($type, 0, 5) === 'text/')1932 if (in_array(substr($type, -4), array('+xml', '/xml'), true) || substr($type, 0, 5) === 'text/') 1933 1933 { 1934 1934 return SIMPLEPIE_CONSTRUCT_NONE; 1935 1935 } -
src/wp-includes/SimplePie/Parser.php
diff --git a/src/wp-includes/SimplePie/Parser.php b/src/wp-includes/SimplePie/Parser.php index 4efdf41a71..e9956976ee 100644
a b class SimplePie_Parser 330 330 $this->datas[] =& $this->data; 331 331 $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][]; 332 332 $this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)); 333 if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content') ) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')334 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content') ) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')335 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_20 && in_array(end($this->element), array('title') ))336 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_090 && in_array(end($this->element), array('title') ))337 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_10 && in_array(end($this->element), array('title') )))333 if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content'), true) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml') 334 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content'), true) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml') 335 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_20 && in_array(end($this->element), array('title'), true)) 336 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_090 && in_array(end($this->element), array('title'), true)) 337 || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_10 && in_array(end($this->element), array('title'), true))) 338 338 { 339 339 $this->current_xhtml_construct = 0; 340 340 } … … class SimplePie_Parser 358 358 if ($this->current_xhtml_construct >= 0) 359 359 { 360 360 $this->current_xhtml_construct--; 361 if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param') ))361 if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'), true)) 362 362 { 363 363 $this->data['data'] .= '</' . end($this->element) . '>'; 364 364 } … … class SimplePie_Parser 418 418 $name = ''; 419 419 $link = ''; 420 420 // Check if h-card is set and pass that information on in the link. 421 if (isset($data['type']) && in_array('h-card', $data['type'] )) {421 if (isset($data['type']) && in_array('h-card', $data['type'], true)) { 422 422 if (isset($data['properties']['name'][0])) { 423 423 $name = $data['properties']['name'][0]; 424 424 } … … class SimplePie_Parser 448 448 // First look for an h-feed. 449 449 $h_feed = array(); 450 450 foreach ($mf['items'] as $mf_item) { 451 if (in_array('h-feed', $mf_item['type'] )) {451 if (in_array('h-feed', $mf_item['type'], true)) { 452 452 $h_feed = $mf_item; 453 453 break; 454 454 } 455 455 // Also look for h-feed or h-entry in the children of each top level item. 456 456 if (!isset($mf_item['children'][0]['type'])) continue; 457 if (in_array('h-feed', $mf_item['children'][0]['type'] )) {457 if (in_array('h-feed', $mf_item['children'][0]['type'], true)) { 458 458 $h_feed = $mf_item['children'][0]; 459 459 // In this case the parent of the h-feed may be an h-card, so use it as 460 460 // the feed_author. 461 if (in_array('h-card', $mf_item['type'] )) $feed_author = $mf_item;461 if (in_array('h-card', $mf_item['type'], true)) $feed_author = $mf_item; 462 462 break; 463 463 } 464 else if (in_array('h-entry', $mf_item['children'][0]['type'] )) {464 else if (in_array('h-entry', $mf_item['children'][0]['type'], true)) { 465 465 $entries = $mf_item['children']; 466 466 // In this case the parent of the h-entry list may be an h-card, so use 467 467 // it as the feed_author. 468 if (in_array('h-card', $mf_item['type'] )) $feed_author = $mf_item;468 if (in_array('h-card', $mf_item['type'], true)) $feed_author = $mf_item; 469 469 break; 470 470 } 471 471 } … … class SimplePie_Parser 484 484 } 485 485 for ($i = 0; $i < count($entries); $i++) { 486 486 $entry = $entries[$i]; 487 if (in_array('h-entry', $entry['type'] )) {487 if (in_array('h-entry', $entry['type'], true)) { 488 488 $item = array(); 489 489 $title = ''; 490 490 $description = ''; … … class SimplePie_Parser 520 520 $mf = Mf2\fetch($author); 521 521 foreach ($mf['items'] as $hcard) { 522 522 // Only interested in an h-card by itself in this case. 523 if (!in_array('h-card', $hcard['type'] )) {523 if (!in_array('h-card', $hcard['type'], true)) { 524 524 continue; 525 525 } 526 526 // It must have a url property matching what we fetched. 527 527 if (!isset($hcard['properties']['url']) || 528 !(in_array($author, $hcard['properties']['url'] ))) {528 !(in_array($author, $hcard['properties']['url'], true))) { 529 529 continue; 530 530 } 531 531 // Save parse_hcard the trouble of finding the correct url. -
src/wp-includes/SimplePie/Registry.php
diff --git a/src/wp-includes/SimplePie/Registry.php b/src/wp-includes/SimplePie/Registry.php index bf3baf1793..a2862bf261 100644
a b class SimplePie_Registry 160 160 { 161 161 $class = $this->get_class($type); 162 162 163 if (in_array($class, $this->legacy ))163 if (in_array($class, $this->legacy, true)) 164 164 { 165 165 switch ($type) 166 166 { … … class SimplePie_Registry 202 202 { 203 203 $class = $this->get_class($type); 204 204 205 if (in_array($class, $this->legacy ))205 if (in_array($class, $this->legacy, true)) 206 206 { 207 207 switch ($type) 208 208 { -
src/wp-includes/SimplePie/Sanitize.php
diff --git a/src/wp-includes/SimplePie/Sanitize.php b/src/wp-includes/SimplePie/Sanitize.php index 35838032fc..dbeefe1784 100644
a b class SimplePie_Sanitize 431 431 $attributes = array($attributes); 432 432 } 433 433 434 if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags ))434 if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags, true)) 435 435 { 436 436 $elements = $document->getElementsByTagName($tag); 437 437 foreach ($elements as $element) … … class SimplePie_Sanitize 455 455 { 456 456 if ($this->encode_instead_of_strip) 457 457 { 458 if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style') ))458 if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'), true)) 459 459 { 460 460 $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8'); 461 461 $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8'); … … class SimplePie_Sanitize 466 466 return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8'); 467 467 } 468 468 } 469 elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style') ))469 elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'), true)) 470 470 { 471 471 return $match[4]; 472 472 } … … class SimplePie_Sanitize 486 486 $fragment = $document->createDocumentFragment(); 487 487 488 488 // For elements which aren't script or style, include the tag itself 489 if (!in_array($tag, array('script', 'style') ))489 if (!in_array($tag, array('script', 'style'), true)) 490 490 { 491 491 $text = '<' . $tag; 492 492 if ($element->hasAttributes()) … … class SimplePie_Sanitize 524 524 $fragment->appendChild($child); 525 525 } 526 526 527 if (!in_array($tag, array('script', 'style') ))527 if (!in_array($tag, array('script', 'style'), true)) 528 528 { 529 529 $fragment->appendChild(new DOMText('</' . $tag . '>')); 530 530 } … … class SimplePie_Sanitize 534 534 535 535 return; 536 536 } 537 elseif (in_array($tag, array('script', 'style') ))537 elseif (in_array($tag, array('script', 'style'), true)) 538 538 { 539 539 foreach ($elements as $element) 540 540 { -
src/wp-includes/sodium_compat/src/Compat.php
diff --git a/src/wp-includes/sodium_compat/src/Compat.php b/src/wp-includes/sodium_compat/src/Compat.php index b2ccd21ddf..70ba6d77cd 100644
a b class ParagonIE_Sodium_Compat 323 323 // OpenSSL isn't installed 324 324 return false; 325 325 } 326 return (bool) in_array('aes-256-gcm', openssl_get_cipher_methods() );326 return (bool) in_array('aes-256-gcm', openssl_get_cipher_methods(), true); 327 327 } 328 328 329 329 /** -
src/wp-includes/sodium_compat/src/Core/Util.php
diff --git a/src/wp-includes/sodium_compat/src/Core/Util.php b/src/wp-includes/sodium_compat/src/Core/Util.php index bde9df1106..262b20cec3 100644
a b abstract class ParagonIE_Sodium_Core_Util 200 200 case 'integer': 201 201 case 'int': 202 202 $allow = array('int', 'integer'); 203 if (!in_array($type, $allow )) {203 if (!in_array($type, $allow, true)) { 204 204 throw new TypeError('Argument ' . $argumentIndex . ' must be an integer, ' . $realType . ' given.'); 205 205 } 206 206 $mixedVar = (int) $mixedVar; … … abstract class ParagonIE_Sodium_Core_Util 208 208 case 'boolean': 209 209 case 'bool': 210 210 $allow = array('bool', 'boolean'); 211 if (!in_array($type, $allow )) {211 if (!in_array($type, $allow, true)) { 212 212 throw new TypeError('Argument ' . $argumentIndex . ' must be a boolean, ' . $realType . ' given.'); 213 213 } 214 214 $mixedVar = (bool) $mixedVar; … … abstract class ParagonIE_Sodium_Core_Util 223 223 case 'double': 224 224 case 'float': 225 225 $allow = array('decimal', 'double', 'float'); 226 if (!in_array($type, $allow )) {226 if (!in_array($type, $allow, true)) { 227 227 throw new TypeError('Argument ' . $argumentIndex . ' must be a float, ' . $realType . ' given.'); 228 228 } 229 229 $mixedVar = (float) $mixedVar;