зеркало из https://github.com/nextcloud/cookbook.git
Corrected HP file styling
Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Родитель
b0b900ffc2
Коммит
535922e5cc
|
@ -216,17 +216,17 @@ class RecipeService {
|
|||
// Make sure that "recipeYield" is an integer which is at least 1
|
||||
if (isset($json['recipeYield']) && $json['recipeYield']) {
|
||||
|
||||
// Check if "recipeYield is an array
|
||||
if(is_array($json['recipeYield'])) {
|
||||
if(count($json['recipeYield']) == 1) {
|
||||
$json['recipeYield'] = $json['recipeYield'][0];
|
||||
} else {
|
||||
// XXX How to parse an array correctly?
|
||||
$json['recipeYield'] = join(' ', $json['recipeYield']);
|
||||
}
|
||||
}
|
||||
|
||||
$regex_matches = [];
|
||||
// Check if "recipeYield is an array
|
||||
if (is_array($json['recipeYield'])) {
|
||||
if (count($json['recipeYield']) == 1) {
|
||||
$json['recipeYield'] = $json['recipeYield'][0];
|
||||
} else {
|
||||
// XXX How to parse an array correctly?
|
||||
$json['recipeYield'] = join(' ', $json['recipeYield']);
|
||||
}
|
||||
}
|
||||
|
||||
$regex_matches = [];
|
||||
preg_match('/(\d*)/', $json['recipeYield'], $regex_matches);
|
||||
if (count($regex_matches) >= 1) {
|
||||
$yield = filter_var($regex_matches[0], FILTER_SANITIZE_NUMBER_INT);
|
||||
|
|
Загрузка…
Ссылка в новой задаче