https://bugs.koozali.org/show_bug.cgi?id=12516
Bug ID: 12516
Summary: Wrong Servers output from template
Classification: Contribs
Product: SME Contribs
Version: 10.0
Hardware: ---
OS: ---
Status: CONFIRMED
Severity: normal
Priority: P3
Component: smeserver-phpmyadmin
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
Target Milestone: ---
Created attachment 6858
--> https://bugs.koozali.org/attachment.cgi?id=6858&action=edit
Test file to check outputs
I was looking at code here to utilise elsewhere and noticed during some test
that the output values were not always correct.
It seems that the printf does not evaluate correctly and it requires sprintf
here:
/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpmyadmin
These two lines do not produce correct results if they hit the printf section:
$min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ?
printf("%.0f",$max_spare_servers/2) : $min_spare_servers;
$start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f",
$max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
The printf needs changing to sprintf like this
$min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ?
sprintf("%.0f",$max_spare_servers/2) : $min_spare_servers;
$start_servers = ( $start_servers > $max_spare_servers ) ? sprintf("%.0f",
$max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers;
I've attached a quick PoC file for testing.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug._______________________________________________
Mail for each SME Contribs bug report
To unsubscribe, e-mail [email protected]
Searchable archive at https://lists.contribs.org/mailman/public/contribteam/