]> git.mxchange.org Git - friendica.git/commitdiff
Issue 3828: Better handling if query doesn't return a value
authorMichael <heluecht@pirati.ca>
Sun, 29 Oct 2017 06:49:43 +0000 (06:49 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 29 Oct 2017 06:49:43 +0000 (06:49 +0000)
include/pgettext.php

index f6f26a8cc4a13b90f8daea14b1ca664f6c8e2f10..da47b8b6c13871ad4970587339f1f2be16dd2420 100644 (file)
@@ -106,13 +106,11 @@ function load_translation_table($lang) {
 
        $a->strings = array();
        // load enabled plugins strings
-       $plugins = q("SELECT name FROM addon WHERE installed=1;");
-       if ($plugins!==false) {
-               foreach ($plugins as $p) {
-                       $name = $p['name'];
-                       if (file_exists("addon/$name/lang/$lang/strings.php")) {
-                               include("addon/$name/lang/$lang/strings.php");
-                       }
+       $plugins = dba::select('addon', array('name'), array('installed' => true));
+       while ($p = dba::fetch($plugins)) {
+               $name = $p['name'];
+               if (file_exists("addon/$name/lang/$lang/strings.php")) {
+                       include("addon/$name/lang/$lang/strings.php");
                }
        }