Bug #2867

Process::getOutput() is incompatible with previous version

Added by Davide Principi almost 7 years ago. Updated almost 7 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:v1.6.1
Security class: Resolution:
Affected version:v1.6.0 NEEDINFO:No

Description

The new Process::getOutput() implementation is not compatible with the previous one: a trailing newline must be chopped to keep the return value consistent with the previous function implementation.

See 07bb798

PHP exec() function returns (by ref) an array of output lines where the last newline char is lost,

    $ php -r '$a = array(); exec("/bin/echo -e -n \"x\n\n\"", $a, $v); print_r($a);'
Array
(
    [0] => x
    [1] => 
)

    $ php -r '$a = array(); exec("/bin/echo -e -n \"x\n\"", $a, $v); print_r($a);'
Array
(
    [0] => x
)

    $ php -r '$a = array(); exec("/bin/echo -e -n \"x\"", $a, $v); print_r($a);'
Array
(
    [0] => x
)


Related issues

Related to NethServer 6 - Bug #2844: Missing translation labels break web interface CLOSED

Associated revisions

Revision 1ada3403
Added by Davide Principi almost 7 years ago

Process (getOutput): chop trailing newline from command output. Refs #2867

Required to keep compatibility with previous Process implementation.

Revision e9b4044e
Added by Davide Principi almost 7 years ago

Process: setTimeout() to infinite for backward compatibility. Refs #2867

History

#1 Updated by Davide Principi almost 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

#2 Updated by Davide Principi almost 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Davide Principi)
  • % Done changed from 30 to 60

#3 Updated by Davide Principi almost 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-httpd-admin-1.3.0-3.4gitad07c55.ns6.noarch.rpm

#4 Updated by Giacomo Sanchietti almost 7 years ago

  • Assignee set to Giacomo Sanchietti

#5 Updated by Giacomo Sanchietti almost 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

Extra newline is now removed.

#6 Updated by Giacomo Sanchietti almost 7 years ago

  • Related to Bug #2844: Missing translation labels break web interface added

#7 Updated by Davide Principi almost 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

Also available in: Atom PDF