wp/wp-includes/class-simplepie.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    18 
    18 
    19 /**
    19 /**
    20  * WordPress autoloader for SimplePie.
    20  * WordPress autoloader for SimplePie.
    21  *
    21  *
    22  * @since 3.5.0
    22  * @since 3.5.0
       
    23  *
       
    24  * @param string $class Class name.
    23  */
    25  */
    24 function wp_simplepie_autoload( $class ) {
    26 function wp_simplepie_autoload( $class ) {
    25 	if ( 0 !== strpos( $class, 'SimplePie_' ) )
    27 	if ( ! str_starts_with( $class, 'SimplePie_' ) )
    26 		return;
    28 		return;
    27 
    29 
    28 	$file = ABSPATH . WPINC . '/' . str_replace( '_', '/', $class ) . '.php';
    30 	$file = ABSPATH . WPINC . '/' . str_replace( '_', '/', $class ) . '.php';
    29 	include $file;
    31 	include $file;
    30 }
    32 }
   336  */
   338  */
   337 define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/');
   339 define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/');
   338 
   340 
   339 /**
   341 /**
   340  * RSS 2.0 Namespace
   342  * RSS 2.0 Namespace
   341  * (Stupid, I know, but I'm certain it will confuse people less with support.)
       
   342  */
   343  */
   343 define('SIMPLEPIE_NAMESPACE_RSS_20', '');
   344 define('SIMPLEPIE_NAMESPACE_RSS_20', '');
   344 
   345 
   345 /**
   346 /**
   346  * DC 1.0 Namespace
   347  * DC 1.0 Namespace
  1201 			$this->cache_name_function = $function;
  1202 			$this->cache_name_function = $function;
  1202 		}
  1203 		}
  1203 	}
  1204 	}
  1204 
  1205 
  1205 	/**
  1206 	/**
  1206 	 * Set options to make SP as fast as possible
  1207 	 * Set options to make SimplePie as fast as possible.
  1207 	 *
  1208 	 *
  1208 	 * Forgoes a substantial amount of data sanitization in favor of speed. This
  1209 	 * Forgoes a substantial amount of data sanitization in favor of speed.
  1209 	 * turns SimplePie into a dumb parser of feeds.
  1210 	 * This turns SimplePie into a less clever parser of feeds.
  1210 	 *
  1211 	 *
  1211 	 * @param bool $set Whether to set them or not
  1212 	 * @param bool $set Whether to set them or not.
  1212 	 */
  1213 	 */
  1213 	public function set_stupidly_fast($set = false)
  1214 	public function set_stupidly_fast($set = false)
  1214 	{
  1215 	{
  1215 		if ($set)
  1216 		if ($set)
  1216 		{
  1217 		{
  1862 	{
  1863 	{
  1863 		return $this->sanitize->output_encoding;
  1864 		return $this->sanitize->output_encoding;
  1864 	}
  1865 	}
  1865 
  1866 
  1866 	/**
  1867 	/**
  1867 	 * Send the content-type header with correct encoding
  1868 	 * Send the Content-Type header with correct encoding
  1868 	 *
  1869 	 *
  1869 	 * This method ensures that the SimplePie-enabled page is being served with
  1870 	 * This method ensures that the SimplePie-enabled page is being served with
  1870 	 * the correct {@link http://www.iana.org/assignments/media-types/ mime-type}
  1871 	 * the correct {@link http://www.iana.org/assignments/media-types/ mime-type}
  1871 	 * and character encoding HTTP headers (character encoding determined by the
  1872 	 * and character encoding HTTP headers (character encoding determined by the
  1872 	 * {@see set_output_encoding} config option).
  1873 	 * {@see set_output_encoding} config option).
  1884 	 */
  1885 	 */
  1885 	public function handle_content_type($mime = 'text/html')
  1886 	public function handle_content_type($mime = 'text/html')
  1886 	{
  1887 	{
  1887 		if (!headers_sent())
  1888 		if (!headers_sent())
  1888 		{
  1889 		{
  1889 			$header = "Content-type: $mime;";
  1890 			$header = "Content-Type: $mime;";
  1890 			if ($this->get_encoding())
  1891 			if ($this->get_encoding())
  1891 			{
  1892 			{
  1892 				$header .= ' charset=' . $this->get_encoding();
  1893 				$header .= ' charset=' . $this->get_encoding();
  1893 			}
  1894 			}
  1894 			else
  1895 			else