Summary | Carriage Return Line Feed supposed to be a $ in multiline entries in LDAP |
Queue | Turba |
Queue Version | HEAD |
Type | Enhancement |
State | Resolved |
Priority | 2. Medium |
Owners | Horde Developers (at) |
Requester | urkle (at) drip (dot) ws |
Created | 03/07/2004 (7739 days ago) |
Due | |
Updated | 03/19/2023 (788 days ago) |
Assigned | 02/20/2005 (7389 days ago) |
Resolved | 03/21/2005 (7360 days ago) |
Milestone | 2.1 |
Patch | No |
New Attachment: 1.php
commit 21e1acaad8a485ccd125d1f36b3f38ab59e81d06
Author: Michael J Rubinsky <mike@theupstairsroom.com>
Date: Wed, 25 Oct 2017 00:29:20 -0400
Merge pull
request #2from BigMichi1/patch-2TypeError: Argument 2 passed to Horde_Db_Adapter_Base::_replaceParameters()
M lib/Faces/Base.php
https://github.com/horde/ansel/commit/21e1acaad8a485ccd125d1f36b3f38ab59e81d06
commit 56d82c6574bfa544f9fd0515d312eaeb442e632a
Author: Michael Cramer <michael@bigmichi1.de>
Date: Sun, 22 Oct 2017 14:30:10 +0200
TypeError: Argument 2 passed to Horde_Db_Adapter_Base::_replaceParameters()
when we do a automatic face detection whit libpuzzle enabled we got an
error about wrong argument type
2017-10-22T12:17:22+00:00 EMERG: HORDE [ansel] TypeError: Argument 2
passed to Horde_Db_Adapter_Base::_replaceParameters() must be of the
type array, integer given, called in
/usr/share/php/Horde/Db/Adapter/Pdo/Base.php on line 364 and d
efined in /usr/share/php/Horde/Db/Adapter/Base.php:784
Stack trace:
#0 /usr/share/php/Horde/Db/Adapter/Pdo/Base.php(364):
Horde_Db_Adapter_Base->_replaceParameters('face_id = ?', 5)
#1/srv/www/docs/ansel/lib/Faces/Base.php(655):Horde_Db_Adapter_Pdo_Base->updateBlob('ansel_faces', Array, Array)
#2/srv/www/docs/ansel/lib/Faces/Base.php(554):Ansel_Faces_Base->saveSignature(4947, 5)
#3/srv/www/docs/ansel/lib/Ajax/Imple/EditFaces.php(50):Ansel_Faces_Base->getFromPicture(Object(Ansel_Image), true)
#4/usr/share/php/Horde/Core/Ajax/Imple.php(120):Ansel_Ajax_Imple_EditFaces->_handle(Object(Horde_Variables))
#5/usr/share/php/Horde/Core/Ajax/Application/Handler/Imple.php(31):Horde_Core_Ajax_Imple->handle(Object(Horde_Variables))
#6/usr/share/php/Horde/Core/Ajax/Application.php(175):Horde_Core_Ajax_Application_Handler_Imple->imple()
#7/srv/www/docs/services/ajax.php(61):Horde_Core_Ajax_Application->doAction()
#8{main} [pid 13479 on line 74 of "/usr/share/php/Horde/ErrorHandler.php"]M lib/Faces/Base.php
https://github.com/horde/ansel/commit/56d82c6574bfa544f9fd0515d312eaeb442e632a
commit df3ecf41b3d85d5ad4a2acf67449d7ceb7e42217
Author: Jan Schneider <jan@horde.org>
Date: Thu Jan 7 15:33:19 2016 +0000
Xde
bug 2.4 adds the location to the var_dump() output. Disable completely..../View/test/Horde/View/Helper/DebugTest.php | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
http://github.com/horde/horde/commit/df3ecf41b3d85d5ad4a2acf67449d7ceb7e42217
State ⇒ Resolved
New Attachment: postal3.diff
function did that as well.. I agree though that It should check the
whole UID. (both functions should).
And as for the _getSchema, I do check if the _schema is a a
Net_LDAP_Schema object and re-fetch, if it's not. It does, however,
make more sense to be a static member.
I'll update the patch with these two suggestions.
State ⇒ Assigned
that you don't check the schema against the full UID for the LDAP
postal address syntax, but only the last token? And you may want to
store the schema in _getSchema in a static variable to cache it and
don't create a new schema object for each request.
New Attachment: postal2.diff
schema checking is enabled.. otherwise it will fail back to relying on
the definitions in attributes.php
New Attachment: postal.diff
should be fixed. I just haven't had the time to work on it recently,
and as I'm not using the horde-CVS it hasn't been that high of a
priority as I already had my own patch in the stable tree I'm using.
I have attached an updated patch off of CVS-HEAD.
This does not use the schema checking that was added, As that is an
"optional" feature (checkRequired) which has to be called first to
initialize the _schema object.. The solution attached back
references the $GLOBALS['attributes'] configuration array after
querying $this->map to map attribute.
State ⇒ Rejected
putting any work into it.
Type ⇒ Enhancement
State ⇒ Stalled
Priority ⇒ 2. Medium
State ⇒ Feedback
for schemes and field syntaxes:
http://cvs.horde.org/diff.php/turba/lib/Driver/ldap.php?r1=1.49&r2=1.50&ty=u
Maybe part of this code could be used/adapted to determine the fields
where we want line breaks encoded as "$"?
State ⇒ Assigned
Priority ⇒ 2. Medium
Taken from Chuck Hagenbuch
don't be silly
New Attachment: ldapaddress.patch
I'm the same person as urkle@d.
A few notes though, right now I am explicitly checking for
homepostaladdress, postaladdress, otherpostaladdress, and
registeredaddress with that lovely regular expression. As those are
the standard core scheme that use this syntax.
It would be better if there were a way to access what type of field is
being processed from within the driver,, or a sheme query on the LDAP
to determine what attributes are of the syntax
1.3.6.1.4.1.1466.115.121.1.41.
And this breaks things with evolution, as I am waiting for them to
accept my patch to fix the bug there as well. Neeed to update it for
the 1.5CVS release.
I'm the same person as urkle@d.
A few notes though, right now I am explicitly checking for
homepostaladdress, postaladdress, otherpostaladdress, and
registeredaddress with that lovely regular expression. As those are
the standard core scheme that use this syntax.
It would be better if there were a way to access what type of field is
being processed from within the driver,, or a sheme query on the LDAP
to determine what attributes are of the syntax
1.3.6.1.4.1.1466.115.121.1.41.
And this breaks things with evolution, as I am waiting for them to
accept my patch to fix the bug there as well. Neeed to update it for
the 1.5CVS release.
Assigned to Chuck Hagenbuch
Priority ⇒ 2. Medium
Return, Line Feed instead of just Line Feed between the lines of a
multiline entry (ie. home address) This causes a problem with Evolution
where evolution will not display the entry in the address book if there is
a carriage return in the entry.. But the entries should only have line
feeds..
Patch for Turba 1.2 AND CVS HEAD
------- Additional Comments From urkle@drip.ws 06/17/03 16:45 -------
CVS HEAD Patch
--- ldap.php.orig Fri Jun 13 10:21:15 2003
+++ ldap.php Tue Jun 17 14:41:25 2003
@@ -302,10 +302,10 @@
// Don't add empty attributes.
$attributes = array_filter($attributes, array($this,
'cleanEmptyAttributes'));
- // Encode entries.
+ // Encode entries & do CRLF to LF conversion
foreach ($attributes as $key => $val) {
if (!is_array($val)) {
- $attributes[$key] = String::convertCharset($val,
NLS::getCharset(), $this->charset);
+ $attributes[$key] =
String::convertCharset(str_replace("\r\n",\n",$val), NLS::getCharset(),
$this->charset);
}
}
@@ -377,7 +377,7 @@
// Encode entries.
foreach ($attributes as $key => $val) {
if (!is_array($val)) {
- $attributes[$key] = String::convertCharset($val,
NLS::getCharset(), $this->charset);
+ $attributes[$key] =
String::convertCharset(str_replace("\r\n","\n",$val), NLS::getCharset(),
$this->charset);
}
}
------- Additional Comments From urkle@drip.ws 06/17/03 16:46 -------
Turba 1.2 patch
--- ldap.php.orig Tue Feb 25 20:40:48 2003
+++ ldap.php Sun Jun 15 23:54:34 2003
@@ -301,14 +301,17 @@
// Don't add empty attributes.
$attributes = array_filter($attributes, array($this,
'cleanEmptyAttributes'));
- // Encode entries in UTF-8 if requested.
- if ($this->encoding == 'utf8') {
- foreach ($attributes as $key => $val) {
- if (!is_array($val)) {
- $attributes[$key] = utf8_encode($val);
- }
- }
- }
+ // fix CRLF to LF in multiline entries
+ foreach ($attributes as $key => $val) {
+ if (!is_array($val)) {
+ $val = str_replace("\r\n","\n",$val);
+ // Encode entries in UTF-8 if requested.
+ if ($this->encoding == 'utf8') {
+ $val = utf8_encode($val);
+ }
+ $attributes[$key] = $val;
+ }
+ }
if (!@ldap_add($this->ds, $dn, $attributes)) {
return new PEAR_Error('Failed to add an object: [' .
ldap_errno($this->ds) . '] "' . ldap_error($this->ds) . '" (attributes: [' .
serialize($attributes) . ']).');
@@ -375,14 +378,17 @@
}
}
- // Encode entries in UTF-8 if requested.
- if ($this->encoding == 'utf8') {
- foreach ($attributes as $key => $val) {
- if (!is_array($val)) {
- $attributes[$key] = utf8_encode($val);
- }
- }
- }
+ // fix CRLF to LF in multiline entries
+ foreach ($attributes as $key => $val) {
+ if (!is_array($val)) {
+ $val = str_replace("\r\n","\n",$val);
+ // Encode entries in UTF-8 if requested.
+ if ($this->encoding == 'utf8') {
+ $val = utf8_encode($val);
+ }
+ $attributes[$key] = $val;
+ }
+ }
unset($attributes[$object_key]);
$attributes = array_filter($attributes, array($this,
'cleanEmptyAttributes'));
------- Additional Comments From urkle@drip.ws 03/06/04 23:39 -------
A way needs to be created to let the driver know that the field type is of
postal address..
------- Additional Comments From urkle@drip.ws 03/07/04 00:12 -------
patch to completely fix this bug.
change both ocurrances of
$val = str_replace("\r\n","\n",$val);
in the second patch posted to this.
if (preg_match("/^((home|other)?postal|registered)address$/",%key)) {
$val = str_replace(array("\r\n","\n"),array("$","$"),$val);
}
and then in the getResults function (around line 243)
if ($field == 'dn') {
$resul[$field] = $entry[$field];
+} elseif (preg_match("/^((home|other)?postal|registered)address$/",$field)) {
+ if (!empty($entry[$field])) {
+ if ($this->encoding == 'utf8') {
+ $result[$field] = utf8_decode($entry[$field][0]);
+ }
+ }
+ $result[$field] = str_replace("$","\r\n",$result[$field]);
} else {
$result[$field] = '';
if (!empty($entry[$field])) {
And
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Type ⇒ Bug
Return, Line Feed instead of just Line Feed between the lines of a
multiline entry (ie. home address) This causes a problem with Evolution
where evolution will not display the entry in the address book if there is
a carriage return in the entry.. But the entries should only have line
feeds..
Patch for Turba 1.2 AND CVS HEAD
------- Additional Comments From urkle@drip.ws 06/17/03 16:45 -------
CVS HEAD Patch
--- ldap.php.orig Fri Jun 13 10:21:15 2003
+++ ldap.php Tue Jun 17 14:41:25 2003
@@ -302,10 +302,10 @@
// Don't add empty attributes.
$attributes = array_filter($attributes, array($this,
'cleanEmptyAttributes'));
- // Encode entries.
+ // Encode entries & do CRLF to LF conversion
foreach ($attributes as $key => $val) {
if (!is_array($val)) {
- $attributes[$key] = String::convertCharset($val,
NLS::getCharset(), $this->charset);
+ $attributes[$key] =
String::convertCharset(str_replace("\r\n",\n",$val), NLS::getCharset(),
$this->charset);
}
}
@@ -377,7 +377,7 @@
// Encode entries.
foreach ($attributes as $key => $val) {
if (!is_array($val)) {
- $attributes[$key] = String::convertCharset($val,
NLS::getCharset(), $this->charset);
+ $attributes[$key] =
String::convertCharset(str_replace("\r\n","\n",$val), NLS::getCharset(),
$this->charset);
}
}