[Dica] allow_url_fopen está desativada

  • Uriel
  • Avatar de Uriel Autor do Tópico
  • Offline
  • JCB! Legend
  • JCB! Legend
Mais
11 anos 4 meses atrás #82353 por Uriel
Uriel replied the topic: Re: [Dica] allow_url_fopen está desativada
isso é no htacess

abraço

Please Entrar ou Registrar to join the conversation.

Mais
11 anos 1 mês atrás #86288 por dimaffa
dimaffa replied the topic: Re: [Dica] allow_url_fopen está desativada
Excelente dica brother. Vlw e parabéns!

Please Entrar ou Registrar to join the conversation.

Mais
10 anos 8 meses atrás #92034 por Wesley.kn
Wesley.kn replied the topic: Re: [Dica] allow_url_fopen está desativada
Eu não consigo achar a onde ta esse tal de htacess, quando eu vou no htacess.txt no meu Gerenciador de arquivos, na pasta Webs, Não tem nenhuma dessas opções, aparece isso aqui.

##
# @package Joomla
# @copyright Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.



A ONDE EU DEVO SUBSTITUI O OU ACRESCENTAR O

php_value allow_url_fopen 1
php_value allow_url_include 1

MEEEEEE AJUUUDEM RS <!-- s:( --><img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Triste" /><!-- s:( -->

Please Entrar ou Registrar to join the conversation.

Mais
10 anos 1 dia atrás #96057 por phdorocha
phdorocha replied the topic: Re: [Dica] allow_url_fopen está desativada

Uriel escreveu: isso é no htacess

abraço

<?
/*
Este código visa substituir a função insegura de url_fopen pelo curl, que funciona da mesma forma no entanto com segurança
*/

$url = "http://www.arcadiapousada.com.br"; //coloque aqui a url para incluir

$ch = curl_init(); // inicializa um controlador
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch); // salva o resultado em $data
curl_close($ch);

xml_parse($xml_parser, $data) 
or die(sprintf("XML error: %s at line %d",
                        xml_error_string(xml_get_error_code($xml_parser)), 
                        xml_get_current_line_number($xml_parser)));
xml_parser_free($xml_parser);
?>

Isso não deveria ser incluso no código PHP da index do Joomla?

Pelo que entendi esse código faz um redirecionamento da função.

Please Entrar ou Registrar to join the conversation.

  • Uriel
  • Avatar de Uriel Autor do Tópico
  • Offline
  • JCB! Legend
  • JCB! Legend
Mais
10 anos 1 dia atrás #96062 por Uriel
Uriel replied the topic: Re: [Dica] allow_url_fopen está desativada
Se for windows sua hospedagem, e IIS isso não funciona!

abraço

Please Entrar ou Registrar to join the conversation.