php / php/php-src

Regression in 8.5: float values are treated as invalid when updating LDAP values

Đang mở
#22,108 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

@Girgias đang làm issue này rồi.

Từ ngày 21/5/2026.

Bug Extension: ldap Status: Needs Triage
Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
103

Mô tả

Description

The following code:

<?php
ldap_modify($ds, $dn, ['shadowlastchange' => round(time() / (24*3600))]);

Resulted in this output:

LDAP value must be of type string|int|bool, float given (0)

But I expected this output instead:

no output, the operation succeeded before

Problem is caused by php_ldap_try_get_ldap_value_from_zval and used by he following commit: https://github.com/php/php-src/commit/636b6a1a59efe655a17e9a4a2d67865b53babe0c

I can obviously now cast all these kind of timestamp calculations with round(...) to int: (int)round(...), but this is existing code which worked for 10+ years.

So the question is: was that BC breach intended, or does it make sense to handle that cast to int automatically in php_ldap_try_get_ldap_value_from_zval?

Ralf

PHP Version
PHP 8.5.5 (cli) (built: Apr 11 2026 06:53:07) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.5, Copyright (c), by Zend Technologies
Operating System

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.