[PHP] Why does CURLOPT_FOLLOWLOCATION require open_basedir to be turned off?

2009-12-13 Thread Alex S Kurilo
I was wondering why CURLOPT_FOLLOWLOCATION requires open_basedir and 
safe_mode to be turned off.


The following was found in the 
changelog(http://www.php.net/ChangeLog-5.php):


Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or safe_mode 
are enabled. (Stefan E., Ilia)


Also I read some forum posts about security restrictions blah-blah but 
didn't find anything specific, unfortunately.


Can anybody explain the reasons of such a strange restriction or tell 
what security issues raises CURLOPT_FOLLOWLOCATION when open_basedir is set?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Why does CURLOPT_FOLLOWLOCATION require open_basedir to be turned off?

2009-12-13 Thread Alex S Kurilo

I can't see any conceivable benefit to this restriction when using 
open_basedir, as I thought that related to the local file system - unless CURL 
can use file:// URLs to access the local system?

That's the problem.
I always use open_basedir (not all the sites on my servers are safe 
enough). And that so called security restriction just makes me fury 
(unless I don't see significant reasons for it). So, in order not to 
irritate my nervous system every time somebody asks me to unset 
open_basedir for CURL I decided to find the roots of that PHP 
developers' action.


And I don't think it's related to the local file system: there is 
another option that restricts protocols while redirecting, 
CURLOPT_REDIR_PROTOCOLS, which allows by default all the protocols 
supported by CURL, but file and scp. So this kind of restriction (do not 
follow file:// while redirecting) would make sense, but not disabling 
FOLLOWLOCATION at all. Either they had a better reason or they messed up 
a bit :)


Still trying to find a better explanation.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problems with HTTPS and maybe an .htaccess???

2009-05-05 Thread Alex S Kurilo aka Kamazee

RewriteRule . index.php


Add an asterisk after the dot:
RewriteRule .* index.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problems with HTTPS and maybe an .htaccess???

2009-05-05 Thread Alex S Kurilo aka Kamazee
No, adding * after the period had no affect at all. Still goes to the  
live site.


Sorry, I misunderstood you. I'm too lazy to read all the message :)

http and https may be handled by different virtual hosts.
http for http://dev.sitename.com/ seems to be configured properly (Virtual host 
at port 80) but not https://dev.sitename.com/ (vhost at port 443).


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Extract variable out of a Class - Function

2009-04-23 Thread Alex S Kurilo aka Kamazee
I have a function within a class. There is a variable inside that  
function which I need to access  use outside of the class/function.


For example ...

Class Test {
function showOutput {
if ($this-url) {
$justTT = substr($this-url,-10,7);
echo $justTT;
}
}

}

I need to use $justTT. How do I get the value of $justTT into a  
different variable outside of this class/function so I can use it in a  
different class?




Return it?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] self in inherited methods

2009-04-21 Thread Alex S Kurilo aka Kamazee

Is it right that 'self' in inherited method still points to the parent?
If it is, can you explain it? It makes me worry :)

Up until 5.3 this was just the way it was. It has been fixed in 5.3.
See here for more info: http://php.net/lsb


Thanks. It seems that 'static' keyword (instead of 'self') is the thing I 
actually need.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] self in inherited methods

2009-04-19 Thread Alex S Kurilo aka Kamazee

Is it right that 'self' in inherited method still points to the parent?
If it is, can you explain it? It makes me worry :)

A piece of code below for example

?php
class MyParent {
   const NAME = 'MyParent';
   public function get_instance() {
   return new self;
   }
   public function get_another_instance() {
   $class_name = get_class($this);
   return new $class_name;
   }
   public function get_name() {
   return self::NAME;
   }
}

class MyClass extends MyParent {
   const NAME = 'MyClass';
}

$a = new MyClass;
$b = $a-get_instance();
$c = $a-get_another_instance();

echo $a-get_name(),\n;
echo get_class($b),\n;
echo get_class($c),\n;
?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php