Skip to content

Commit

Permalink
fix bug#2860 (call-time pass-by-reference)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Wagner committed Mar 1, 2005
1 parent 40e6bb3 commit 48e2dda
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions LDAP.php
Expand Up @@ -142,7 +142,7 @@ function &connect($config = array())
if (!function_exists('ldap_connect')){
return $this->raiseError("It seems that you do not have the ldap-extension installed. Please install it before using this package.");
}
@$obj = & new Net_LDAP($config);
@$obj =& new Net_LDAP($config);
$err = $obj->bind();

if (Net_LDAP::isError($err)) {
Expand Down Expand Up @@ -261,7 +261,7 @@ function startTLS()
function start_tls()
{
$args = func_get_args();
return call_user_func_array(array( &$this, 'startTLS' ), $args);
return call_user_func_array(array($this, 'startTLS' ), $args);
}

/**
Expand Down Expand Up @@ -593,7 +593,7 @@ function search($base = null, $filter = null, $params = array())

if ($err == 32) {
// Errorcode 32 = no such object, i.e. a nullresult.
return $obj = & new Net_LDAP_Search (& $search, $this->_link);
return $obj =& new Net_LDAP_Search ($search, $this->_link);

// Errorcode 4 = sizelimit exeeded. this will be handled better in time...
//} elseif ($err == 4) {
Expand All @@ -607,7 +607,7 @@ function search($base = null, $filter = null, $params = array())
return $this->raiseError($this->errorMessage($err) . $msg, $err);
}
} else {
@$obj = & new Net_LDAP_Search($search, $this->_link);
@$obj =& new Net_LDAP_Search($search, $this->_link);
return $obj;
}

Expand Down Expand Up @@ -902,7 +902,7 @@ function &rootDse($attrs = null)
function &root_dse()
{
$args = func_get_args();
return call_user_func_array(array(&$this, 'rootDse'), $args);
return call_user_func_array(array($this, 'rootDse'), $args);
}

/**
Expand All @@ -917,7 +917,7 @@ function &schema($dn = null)
{
require_once('Net/LDAP/Schema.php');

$schema = & new Net_LDAP_Schema();
$schema =& new Net_LDAP_Schema();

if (is_null($dn)) {
// get the subschema entry via root dse
Expand Down
10 changes: 5 additions & 5 deletions LDAP/RootDSE.php
Expand Up @@ -73,7 +73,7 @@ function getValue($attr = '', $options = '')
function get_value()
{
$args = func_get_args();
return call_user_func_array(array( &$this, 'getValue' ), $args);
return call_user_func_array(array($this, 'getValue' ), $args);
}

/**
Expand All @@ -96,7 +96,7 @@ function supportedExtension($oids)
function supported_extension()
{
$args = func_get_args();
return call_user_func_array(array( &$this, 'supportedExtension'), $args);
return call_user_func_array(array($this, 'supportedExtension'), $args);
}

/**
Expand All @@ -119,7 +119,7 @@ function supportedVersion($versions)
function supported_version()
{
$args = func_get_args();
return call_user_func_array(array(&$this, 'supportedVersion'), $args);
return call_user_func_array(array($this, 'supportedVersion'), $args);
}

/**
Expand All @@ -142,7 +142,7 @@ function supportedControl($oids)
function supported_control()
{
$args = func_get_args();
return call_user_func_array(array(&$this, 'supportedControl' ), $args);
return call_user_func_array(array($this, 'supportedControl' ), $args);
}

/**
Expand All @@ -165,7 +165,7 @@ function supportedSASLMechanism($mechlist)
function supported_sasl_mechanism()
{
$args = func_get_args();
return call_user_func_array(array(&$this, 'supportedSASLMechanism'), $args);
return call_user_func_array(array($this, 'supportedSASLMechanism'), $args);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions LDAP/Schema.php
Expand Up @@ -233,13 +233,13 @@ function parse(&$entry)
$schema_entry['type'] = $type;

// save a ref in $_oids
$this->_oids[$schema_entry['oid']] = &$schema_entry;
$this->_oids[$schema_entry['oid']] =& $schema_entry;

// save refs for all names in type map
$names = $schema_entry['aliases'];
array_push($names, $schema_entry['name']);
foreach ($names as $name) {
$this->{$type_var}[strtolower($name)] = &$schema_entry;
$this->{$type_var}[strtolower($name)] =& $schema_entry;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions LDAP/Search.php
Expand Up @@ -104,13 +104,13 @@ function entries()
}

$this->_elink = @ldap_first_entry( $this->_link,$this->_search);
$entry = new Net_LDAP_Entry(&$this->_link,
$entry = new Net_LDAP_Entry($this->_link,
@ldap_get_dn($this->_link, $this->_elink),
@ldap_get_attributes($this->_link, $this->_elink));
array_push($this->_entries, $entry);

while ($this->_elink = @ldap_next_entry($this->_link,$this->_elink)) {
$entry = new Net_LDAP_Entry(&$this->_link,
$entry = new Net_LDAP_Entry($this->_link,
@ldap_get_dn($this->_link, $this->_elink),
@ldap_get_attributes($this->_link, $this->_elink));
array_push($this->_entries, $entry);
Expand All @@ -131,14 +131,14 @@ function shiftEntry()

if (is_null($this->_elink)) {
$this->_elink = @ldap_first_entry($this->_link, $this->_search);
$entry = new Net_LDAP_Entry(&$this->_link,
$entry = new Net_LDAP_Entry($this->_link,
ldap_get_dn($this->_link, $this->_elink),
ldap_get_attributes($this->_link, $this->_elink));
} else {
if (!$this->_elink = ldap_next_entry($this->_link, $this->_elink)) {
return false;
}
$entry = new Net_LDAP_Entry(&$this->_link,
$entry = new Net_LDAP_Entry($this->_link,
ldap_get_dn($this->_link,$this->_elink),
ldap_get_attributes($this->_link,$this->_elink));
}
Expand All @@ -153,7 +153,7 @@ function shiftEntry()
function shift_entry()
{
$args = func_get_args();
return call_user_func_array(array( &$this, 'shiftEntry' ), $args);
return call_user_func_array(array($this, 'shiftEntry'), $args);
}

/**
Expand Down

0 comments on commit 48e2dda

Please sign in to comment.