Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

lucianouru

Wordpress 3.1.2 esta com erro !

Recommended Posts

Olá o wordpress está dando erro na pagina inicial aparecendo a seguinte frase:

Warning: php_uname() has been disabled for security reasons in /home/vhosts/radioeletrojovem.orgfree.com/v1/wp-content/themes/magzimus-blog-magazine-theme/magzimus/includes/thumbnails.php on line 269

O codigo que fala que ta o erro e esse:

<?
/**
* Functions to handle and manipulate the thumbnails behaviour and display
* Since 2.9, it serves mostly as a backup function for old posts that don't contain thumbnails
* Exclusive to the Magzimus theme
* 
* @package WordPress
* @subpackage Magzimus
**/


ini_set('display_errors','1');
ini_set('display_startup_errors','1');
error_reporting(E_ALL ^ E_NOTICE);

class thumbnail {

function thumbnail($src, $width = 100, $height = 133, $position = 'left', $crop = 1, $quality = 80) {

	$this->src = $src;
	$this->width = $width;
	$this->height = $height;
	$this->position = $position;
	$this->crop = $crop;
	$this->quality = $quality;

	$this->doc_root = '';
	$this->mime_type = '';
	$this->thumb_src = '';
	$this->cache_dir = './cache';

}

//Main Process
function make() {
	$this->src = str_replace(get_bloginfo('siteurl') . '/', '', $this->src);

	$this->get_document_root();
	$this->get_mime_type();

	// make sure that the src is gif/jpg/png
	if(!$this->valid_src_mime_type($this->mime_type)) { //Overchecking?
	    die("Invalid src mime type: $mime_type");
	}

	// check to see if GD function exist
	if(!function_exists('imagecreatetruecolor')) {
		die("GD Library Error: imagecreatetruecolor does not exist");
	}
	if(strlen($this->src) && file_exists($this->src)) {
		$this->generate_thumbnail();
	}
	else {

		//If you want to add a default image, this is the place
		//$this->thumb_src = 'wp-content/.jpg';

	}

}

//Generate the new image, the magic happens here
function generate_thumbnail() {

	// open the existing image
	$image = $this->open_image();
	if($image === false) {
		die('Unable to open image : ' . $this->src);
	}

	// Get original width and height
	$width = imagesx($image);
	$height = imagesy($image);

	// don't allow new width or height to be greater than the original
	/*if( $this->width > $width ) {
		$this->width = $width;
	}
	if( $this->height > $height ) {
		$this->height = $height;
	}*/

	// generate new w/h if not provided
	if( $this->width && !$this->height ) {

		$this->height = $height * ( $this->width / $width );

	} elseif($this->height && !$this->width) {

		$this->width = $width * ( $this->height / $height );

	} elseif(!$this->width && !$this->height) {

		$this->width = $width;
		$this->height = $height;

	}

	// create a new true color image
	$canvas = imagecreatetruecolor( $this->width, $this->height );

	if( $this->crop ) {

		$src_x = $src_y = 0;
		$src_w = $width;
		$src_h = $height;

		$cmp_x = $width  / $this->width;
		$cmp_y = $height / $this->height;

		// calculate x or y coordinate and width or height of source

		if ( $cmp_x > $cmp_y ) {

			$src_w = round( ( $width / $cmp_x * $cmp_y ) );
			$src_x = round( ( $width - ( $width / $cmp_x * $cmp_y ) ) / 2 );

		} elseif ( $cmp_y > $cmp_x ) {

			$src_h = round( ( $height / $cmp_y * $cmp_x ) );
			$src_y = round( ( $height - ( $height / $cmp_y * $cmp_x ) ) / 2 );

		}

		imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h );

	} else {

		// copy and resize part of an image with resampling
		imagecopyresampled( $canvas, $image, 0, 0, 0, 0, $this->width, $this->height, $width, $height );

	}

	// output image to browser based on mime type
	//$this->show_image( $canvas );

	$this->thumb_src = basename($this->src);
	$target_dir = str_replace($this->thumb_src, '', $this->src);
	$this->thumb_src = $target_dir . str_replace('.', '_thumb' . $this->width . 'x' . $this->height . '.', $this->thumb_src);

	//echo $this->thumb_src;

	if(!file_exists($this->thumb_src)) {

		if(stristr($this->mime_type, 'gif')) {

			if(!@imagegif($canvas, $this->thumb_src)) {
				$thumbnail = get_bloginfo('stylesheet_directory') . '/images/default_thumbnail.jpg';
				?><img src="<?php echo $thumbnail; ?>" alt="thumbnail" /><?php
			}

		} elseif(stristr($this->mime_type, 'jpeg')) {

			if(!@imagejpeg($canvas, $this->thumb_src, $this->quality)) {
				$thumbnail = get_bloginfo('stylesheet_directory') . '/images/default_thumbnail.jpg';
				?><img src="<?php echo $thumbnail; ?>" alt="thumbnail" /><?php
			}

		} elseif(stristr($this->mime_type, 'png')) {

			if(!@imagepng($canvas, $this->thumb_src, 9)) {
				$thumbnail = get_bloginfo('stylesheet_directory') . '/images/default_thumbnail.jpg';
				?><img src="<?php echo $thumbnail; ?>" alt="thumbnail" /><?php
			}

		}

	}

	// remove image from memory
	imagedestroy( $canvas );

}

function get_tag( $attributes = '' ) {

	//print_r($attributes);

	if(file_exists($this->thumb_src)) {
		$attributes_markup = '';
		foreach($attributes as $attr => $value) {
			$attributes_markup .= $attr.'="'. $value .'" ';
		}
		$tag = '<img src="' . get_bloginfo('home') . '/' . $this->thumb_src . '" ' . $attributes_markup . ' />';
		return $tag;
	}

}

function generate_tag( $attributes = '' ) {

	//print_r($attributes);

	if(file_exists($this->thumb_src)) {
		$attributes_markup = '';
		foreach($attributes as $attr => $value) {
			$attributes_markup .= $attr.'="'. $value .'"';
		}
		$tag = '<img src="' . get_bloginfo('home') . '/' . $this->thumb_src . '" ' . $attributes_markup . ' />';
		echo $tag;
	}

}

function open_image() {

	if(stristr($this->mime_type, 'gif')) {

		$image = imagecreatefromgif($this->src);

	} elseif(stristr($this->mime_type, 'jpeg')) {

		@ini_set('gd.jpeg_ignore_warning', 1);
		$image = imagecreatefromjpeg($this->src);

	} elseif( stristr($this->mime_type, 'png')) {

		$image = imagecreatefrompng($this->src);

	}

	return $image;

}

function clean_source () {

	// remove http/ https/ ftp
	$this->src = preg_replace("/^((ht|f)tp(s|):\/\/)/i", "", $this->src);

	// remove domain name from the source url
	$host = $_SERVER["HTTP_HOST"];
	$this->src = str_replace($host, "", $this->src);
	$host = str_replace("www.", "", $host);
	$this->src = str_replace($host, "", $this->src);

	//$src = preg_replace( "/(?:^\/+|\.{2,}\/+?)/", "", $src );
	//$src = preg_replace( '/^\w+:\/\/[^\/]+/', '', $src );

	// don't allow users the ability to use '../' 
	// in order to gain access to files below document root

	// src should be specified relative to document root like:
	// src=images/img.jpg or src=/images/img.jpg
	// not like:
	// src=../images/img.jpg
	$this->src = preg_replace( "/\.\.+\//", "", $this->src );
	$this->src = substr($this->src, 1, strlen($this->src));
}

function get_document_root () {
	if( @file_exists( $_SERVER['DOCUMENT_ROOT'] . '/' . $this->src ) ) {
		$this->doc_root = $_SERVER['DOCUMENT_ROOT'];
	}
	// the relative paths below are useful if timthumb is moved outside of document root
	// specifically if installed in wordpress themes like mimbo pro:
	// /wp-content/themes/mimbopro/scripts/timthumb.php
	$paths = array( '..', '../..', '../../..', '../../../..' );
	foreach( $paths as $path ) {
		if( @file_exists( $path . '/' . $this->src ) ) {
			$this->doc_root = $path;
		}
	}

}

function get_mime_type() {

    $os = strtolower(php_uname());
	$mime_type = '';

	// use PECL fileinfo to determine mime type
	if( function_exists('finfo_open')) {
		$finfo = finfo_open(FILEINFO_MIME);
		$mime_type = finfo_file($finfo, $this->src);
		finfo_close($finfo);
	}

	// try to determine mime type by using unix file command
	// this should not be executed on windows
    if(!$this->valid_src_mime_type($mime_type) && !(eregi('windows', $os))) {
		if(preg_match("/freebsd|linux/", $os)) {
			$mime_type = trim(@shell_exec('file -bi $file'));
		}
	}

	// use file's extension to determine mime type
	if(!$this->valid_src_mime_type($mime_type)) {

		// set defaults
		$mime_type = 'image/jpeg';
		// file details
		$fileDetails = pathinfo($this->src);
		$ext = strtolower($fileDetails["extension"]);
		// mime types
		$types = array(
 			'jpg'  => 'image/jpeg',
 			'jpeg' => 'image/jpeg',
 			'png'  => 'image/png',
 			'gif'  => 'image/gif'
 		);

		if(strlen($ext) && strlen($types[$ext])) {
			$mime_type = $types[$ext];
		}

	}

	$this->mime_type = $mime_type;

}

function valid_src_mime_type($mime_type) {

	if(preg_match("/jpg|jpeg|gif|png/i", $mime_type)) {
		return true;
	}
	return false;

}

function check_cache() {

	// make sure cache dir exists
	if(!file_exists($this->cache_dir)) {
		// give 777 permissions so that developer can overwrite
		// files created by web server user
		mkdir($this->cache_dir);
		chmod($this->cache_dir, 0777);
	}

	$this->show_cache_file($this->cache_dir);

}

function show_cache_file() {

	$cache_file = $this->cache_dir . '/' . $this->get_cache_file();

	if( file_exists( $cache_file ) ) {

	    if( isset( $_SERVER[ "HTTP_IF_MODIFIED_SINCE" ] ) ) {

			// check for updates
			$if_modified_since = preg_replace( '/;.*$/', '', $_SERVER[ "HTTP_IF_MODIFIED_SINCE" ] );					
			$gmdate_mod = gmdate( 'D, d M Y H:i:s', filemtime( $cache_file ) );

			if( strstr( $gmdate_mod, 'GMT' ) ) {
				$gmdate_mod .= " GMT";
			}

			if ( $if_modified_since == $gmdate_mod ) {
				header( "HTTP/1.1 304 Not Modified" );
				exit;
			}

		}

		$fileSize = filesize($cache_file);

		// send headers then display image
		header("Content-Type: " . $this->mime_type);
		//header("Accept-Ranges: bytes");
		header("Last-Modified: " . gmdate('D, d M Y H:i:s', filemtime($cache_file)) . " GMT");
		header("Content-Length: " . $fileSize);
		header("Cache-Control: max-age=9999, must-revalidate");
		header("Expires: " . gmdate("D, d M Y H:i:s", time() + 9999) . "GMT");

		readfile($cache_file);

		die();

	}

}

function get_cache_file () {

	static $cache_file;
	if(!$cache_file) {
		$frags = split( "\.", $_REQUEST['src'] );
		$ext = strtolower( $frags[ count( $frags ) - 1 ] );
		if(!$this->valid_extension($ext)) { $ext = 'jpg'; }
		//$cachename = get_request( 'src', 'timthumb' ) . get_request( 'w', 100 ) . get_request( 'h', 100 ) . get_request( 'zc', 1 ) . get_request( '9', 80 );
		//$cachename = $this->get_request( 'src', 'timthumb' ) . $this->width . $this->height . $this->crop . $this->quality;
		$cachename = $this->src . $this->width . $this->height . $this->crop . $this->quality;
		$cache_file = md5( $cachename ) . '.' . $ext;
	}
	return $cache_file;

}

function get_request( $property, $default = 0 ) {

	if( isset($_REQUEST[$property]) ) {
		return $_REQUEST[$property];
	} else {
		return $default;
	}

}

function valid_extension ($ext) {

	if( preg_match( "/jpg|jpeg|png|gif/i", $ext ) ) return 1;
	return 0;

}	


}


?>

Veja o erro na imagem agora:

1234.JPG

Bom a versão e a 3.1.2 (nova versão) !

Alguem souber como resolver esse poblema me avise por favor !

Compartilhar este post


Link para o post
Compartilhar em outros sites

Como a mensagem informa a função php_uname está desabilitada no servidor que você está usando.

 

Experimente utilizar a constante PHP_OS no lugar desta função.

Tudo bem mais como posso fazer isto porque estou usando o sistema em php do wordpress e num tenho a minima ideia de como modificar o arquivo você pode da uma ajuda para mim ?

Obrigado desde já !

Compartilhar este post


Link para o post
Compartilhar em outros sites

Como você está usando um CMS pronto o mais certo seria você procurar um servidor melhorzinho que no mínimo seja compatível com o WordPress, pois se você alterar o core do sistema poderá ter problemas na hora de atualizá-lo para uma versão mais recente.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu já falei o que você precisa fazer, trocar a função php_uname na linha que mostra o erro pela constante PHP_OS.

 

E agora que vi, essa sua classe faz parte de um tema do WordPress e não do core dele, portanto não haverá problemas com atualizações.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom eu troquei o que você falou mais agora não aparece a imagem do post e nem o rodapé da pagina !

essa e a linha que fala o erro:

$os = strtolower(php_uname());

Eu troquei por:

$os = strtolower(PHP_OS());

Bom ae deu esse erro na pagina toda o que fazer agora ?

 

IMAGEM:

12345.JPG

 

Se alguem tiver uma solução fala ae !

Compartilhar este post


Link para o post
Compartilhar em outros sites

PHP_EOL ? aonde ta isso ?

faiz um favor pra fica mais facil configura pra mim e posta aqui seria mais rapido e não ficaria enchendo o saco de vocês ;)

O Codigo e esse:

<?
/**
* Functions to handle and manipulate the thumbnails behaviour and display
* Since 2.9, it serves mostly as a backup function for old posts that don't contain thumbnails
* Exclusive to the Magzimus theme
* 
* @package WordPress
* @subpackage Magzimus
**/


ini_set('display_errors','1');
ini_set('display_startup_errors','1');
error_reporting(E_ALL ^ E_NOTICE);

class thumbnail {

function thumbnail($src, $width = 100, $height = 133, $position = 'left', $crop = 1, $quality = 80) {

	$this->src = $src;
	$this->width = $width;
	$this->height = $height;
	$this->position = $position;
	$this->crop = $crop;
	$this->quality = $quality;

	$this->doc_root = '';
	$this->mime_type = '';
	$this->thumb_src = '';
	$this->cache_dir = './cache';

}

//Main Process
function make() {
	$this->src = str_replace(get_bloginfo('siteurl') . '/', '', $this->src);

	$this->get_document_root();
	$this->get_mime_type();

	// make sure that the src is gif/jpg/png
	if(!$this->valid_src_mime_type($this->mime_type)) { //Overchecking?
	    die("Invalid src mime type: $mime_type");
	}

	// check to see if GD function exist
	if(!function_exists('imagecreatetruecolor')) {
		die("GD Library Error: imagecreatetruecolor does not exist");
	}
	if(strlen($this->src) && file_exists($this->src)) {
		$this->generate_thumbnail();
	}
	else {

		//If you want to add a default image, this is the place
		//$this->thumb_src = 'wp-content/.jpg';

	}

}

//Generate the new image, the magic happens here
function generate_thumbnail() {

	// open the existing image
	$image = $this->open_image();
	if($image === false) {
		die('Unable to open image : ' . $this->src);
	}

	// Get original width and height
	$width = imagesx($image);
	$height = imagesy($image);

	// don't allow new width or height to be greater than the original
	/*if( $this->width > $width ) {
		$this->width = $width;
	}
	if( $this->height > $height ) {
		$this->height = $height;
	}*/

	// generate new w/h if not provided
	if( $this->width && !$this->height ) {

		$this->height = $height * ( $this->width / $width );

	} elseif($this->height && !$this->width) {

		$this->width = $width * ( $this->height / $height );

	} elseif(!$this->width && !$this->height) {

		$this->width = $width;
		$this->height = $height;

	}

	// create a new true color image
	$canvas = imagecreatetruecolor( $this->width, $this->height );

	if( $this->crop ) {

		$src_x = $src_y = 0;
		$src_w = $width;
		$src_h = $height;

		$cmp_x = $width  / $this->width;
		$cmp_y = $height / $this->height;

		// calculate x or y coordinate and width or height of source

		if ( $cmp_x > $cmp_y ) {

			$src_w = round( ( $width / $cmp_x * $cmp_y ) );
			$src_x = round( ( $width - ( $width / $cmp_x * $cmp_y ) ) / 2 );

		} elseif ( $cmp_y > $cmp_x ) {

			$src_h = round( ( $height / $cmp_y * $cmp_x ) );
			$src_y = round( ( $height - ( $height / $cmp_y * $cmp_x ) ) / 2 );

		}

		imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h );

	} else {

		// copy and resize part of an image with resampling
		imagecopyresampled( $canvas, $image, 0, 0, 0, 0, $this->width, $this->height, $width, $height );

	}

	// output image to browser based on mime type
	//$this->show_image( $canvas );

	$this->thumb_src = basename($this->src);
	$target_dir = str_replace($this->thumb_src, '', $this->src);
	$this->thumb_src = $target_dir . str_replace('.', '_thumb' . $this->width . 'x' . $this->height . '.', $this->thumb_src);

	//echo $this->thumb_src;

	if(!file_exists($this->thumb_src)) {

		if(stristr($this->mime_type, 'gif')) {

			if(!@imagegif($canvas, $this->thumb_src)) {
				$thumbnail = get_bloginfo('stylesheet_directory') . '/images/default_thumbnail.jpg';
				?><img src="<?php echo $thumbnail; ?>" alt="thumbnail" /><?php
			}

		} elseif(stristr($this->mime_type, 'jpeg')) {

			if(!@imagejpeg($canvas, $this->thumb_src, $this->quality)) {
				$thumbnail = get_bloginfo('stylesheet_directory') . '/images/default_thumbnail.jpg';
				?><img src="<?php echo $thumbnail; ?>" alt="thumbnail" /><?php
			}

		} elseif(stristr($this->mime_type, 'png')) {

			if(!@imagepng($canvas, $this->thumb_src, 9)) {
				$thumbnail = get_bloginfo('stylesheet_directory') . '/images/default_thumbnail.jpg';
				?><img src="<?php echo $thumbnail; ?>" alt="thumbnail" /><?php
			}

		}

	}

	// remove image from memory
	imagedestroy( $canvas );

}

function get_tag( $attributes = '' ) {

	//print_r($attributes);

	if(file_exists($this->thumb_src)) {
		$attributes_markup = '';
		foreach($attributes as $attr => $value) {
			$attributes_markup .= $attr.'="'. $value .'" ';
		}
		$tag = '<img src="' . get_bloginfo('home') . '/' . $this->thumb_src . '" ' . $attributes_markup . ' />';
		return $tag;
	}

}

function generate_tag( $attributes = '' ) {

	//print_r($attributes);

	if(file_exists($this->thumb_src)) {
		$attributes_markup = '';
		foreach($attributes as $attr => $value) {
			$attributes_markup .= $attr.'="'. $value .'"';
		}
		$tag = '<img src="' . get_bloginfo('home') . '/' . $this->thumb_src . '" ' . $attributes_markup . ' />';
		echo $tag;
	}

}

function open_image() {

	if(stristr($this->mime_type, 'gif')) {

		$image = imagecreatefromgif($this->src);

	} elseif(stristr($this->mime_type, 'jpeg')) {

		@ini_set('gd.jpeg_ignore_warning', 1);
		$image = imagecreatefromjpeg($this->src);

	} elseif( stristr($this->mime_type, 'png')) {

		$image = imagecreatefrompng($this->src);

	}

	return $image;

}

function clean_source () {

	// remove http/ https/ ftp
	$this->src = preg_replace("/^((ht|f)tp(s|):\/\/)/i", "", $this->src);

	// remove domain name from the source url
	$host = $_SERVER["HTTP_HOST"];
	$this->src = str_replace($host, "", $this->src);
	$host = str_replace("www.", "", $host);
	$this->src = str_replace($host, "", $this->src);

	//$src = preg_replace( "/(?:^\/+|\.{2,}\/+?)/", "", $src );
	//$src = preg_replace( '/^\w+:\/\/[^\/]+/', '', $src );

	// don't allow users the ability to use '../' 
	// in order to gain access to files below document root

	// src should be specified relative to document root like:
	// src=images/img.jpg or src=/images/img.jpg
	// not like:
	// src=../images/img.jpg
	$this->src = preg_replace( "/\.\.+\//", "", $this->src );
	$this->src = substr($this->src, 1, strlen($this->src));
}

function get_document_root () {
	if( @file_exists( $_SERVER['DOCUMENT_ROOT'] . '/' . $this->src ) ) {
		$this->doc_root = $_SERVER['DOCUMENT_ROOT'];
	}
	// the relative paths below are useful if timthumb is moved outside of document root
	// specifically if installed in wordpress themes like mimbo pro:
	// /wp-content/themes/mimbopro/scripts/timthumb.php
	$paths = array( '..', '../..', '../../..', '../../../..' );
	foreach( $paths as $path ) {
		if( @file_exists( $path . '/' . $this->src ) ) {
			$this->doc_root = $path;
		}
	}

}

function get_mime_type() {

    $os = strtolower(php_uname());
	$mime_type = '';

	// use PECL fileinfo to determine mime type
	if( function_exists('finfo_open')) {
		$finfo = finfo_open(FILEINFO_MIME);
		$mime_type = finfo_file($finfo, $this->src);
		finfo_close($finfo);
	}

	// try to determine mime type by using unix file command
	// this should not be executed on windows
    if(!$this->valid_src_mime_type($mime_type) && !(eregi('windows', $os))) {
		if(preg_match("/freebsd|linux/", $os)) {
			$mime_type = trim(@shell_exec('file -bi $file'));
		}
	}

	// use file's extension to determine mime type
	if(!$this->valid_src_mime_type($mime_type)) {

		// set defaults
		$mime_type = 'image/jpeg';
		// file details
		$fileDetails = pathinfo($this->src);
		$ext = strtolower($fileDetails["extension"]);
		// mime types
		$types = array(
 			'jpg'  => 'image/jpeg',
 			'jpeg' => 'image/jpeg',
 			'png'  => 'image/png',
 			'gif'  => 'image/gif'
 		);

		if(strlen($ext) && strlen($types[$ext])) {
			$mime_type = $types[$ext];
		}

	}

	$this->mime_type = $mime_type;

}

function valid_src_mime_type($mime_type) {

	if(preg_match("/jpg|jpeg|gif|png/i", $mime_type)) {
		return true;
	}
	return false;

}

function check_cache() {

	// make sure cache dir exists
	if(!file_exists($this->cache_dir)) {
		// give 777 permissions so that developer can overwrite
		// files created by web server user
		mkdir($this->cache_dir);
		chmod($this->cache_dir, 0777);
	}

	$this->show_cache_file($this->cache_dir);

}

function show_cache_file() {

	$cache_file = $this->cache_dir . '/' . $this->get_cache_file();

	if( file_exists( $cache_file ) ) {

	    if( isset( $_SERVER[ "HTTP_IF_MODIFIED_SINCE" ] ) ) {

			// check for updates
			$if_modified_since = preg_replace( '/;.*$/', '', $_SERVER[ "HTTP_IF_MODIFIED_SINCE" ] );					
			$gmdate_mod = gmdate( 'D, d M Y H:i:s', filemtime( $cache_file ) );

			if( strstr( $gmdate_mod, 'GMT' ) ) {
				$gmdate_mod .= " GMT";
			}

			if ( $if_modified_since == $gmdate_mod ) {
				header( "HTTP/1.1 304 Not Modified" );
				exit;
			}

		}

		$fileSize = filesize($cache_file);

		// send headers then display image
		header("Content-Type: " . $this->mime_type);
		//header("Accept-Ranges: bytes");
		header("Last-Modified: " . gmdate('D, d M Y H:i:s', filemtime($cache_file)) . " GMT");
		header("Content-Length: " . $fileSize);
		header("Cache-Control: max-age=9999, must-revalidate");
		header("Expires: " . gmdate("D, d M Y H:i:s", time() + 9999) . "GMT");

		readfile($cache_file);

		die();

	}

}

function get_cache_file () {

	static $cache_file;
	if(!$cache_file) {
		$frags = split( "\.", $_REQUEST['src'] );
		$ext = strtolower( $frags[ count( $frags ) - 1 ] );
		if(!$this->valid_extension($ext)) { $ext = 'jpg'; }
		//$cachename = get_request( 'src', 'timthumb' ) . get_request( 'w', 100 ) . get_request( 'h', 100 ) . get_request( 'zc', 1 ) . get_request( '9', 80 );
		//$cachename = $this->get_request( 'src', 'timthumb' ) . $this->width . $this->height . $this->crop . $this->quality;
		$cachename = $this->src . $this->width . $this->height . $this->crop . $this->quality;
		$cache_file = md5( $cachename ) . '.' . $ext;
	}
	return $cache_file;

}

function get_request( $property, $default = 0 ) {

	if( isset($_REQUEST[$property]) ) {
		return $_REQUEST[$property];
	} else {
		return $default;
	}

}

function valid_extension ($ext) {

	if( preg_match( "/jpg|jpeg|png|gif/i", $ext ) ) return 1;
	return 0;

}	


}


?>

 

Posta ai pra mim beleza !

Vlw desde já !

Compartilhar este post


Link para o post
Compartilhar em outros sites

Desculpe, eu quis dizer PHP_OS, já editei o último post.

 

Se o erro está na linha 269 apenas essa linha nos interessa, certo?

 

Então vamos lá, deixe-a assim:

 

$os = strtolower(PHP_OS);

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.