Completed
Pull Request — master (#313)
by Thomas
18:19 queued 08:41
created
htdocs/editdesc.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,9 +19,12 @@  discard block
 block discarded – undo
19 19
     require $stylepath . '/editdesc.inc.php';
20 20
 
21 21
     // check for old-style parameters
22
-    if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid']))  // Ocprop
22
+    if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid'])) {
23
+        // Ocprop
23 24
     {
24
-        $cache_id = $_REQUEST['cacheid'];  // Ocprop
25
+        $cache_id = $_REQUEST['cacheid'];
26
+    }
27
+    // Ocprop
25 28
         $desc_lang = $_REQUEST['desclang'];  // Ocprop
26 29
 
27 30
         $rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang);
@@ -87,10 +90,13 @@  discard block
 block discarded – undo
87 90
                 $show_all_langs = false;
88 91
 
89 92
                 //save to DB?
90
-                if (isset($_POST['post']))  // Ocprop
93
+                if (isset($_POST['post'])) {
94
+                    // Ocprop
91 95
                 {
92 96
                     //here we read all used information from the form if submitted
93
-                    $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1;  // Ocprop
97
+                    $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1;
98
+                }
99
+                // Ocprop
94 100
 
95 101
                     // fuer alte Versionen von OCProp
96 102
                     if (isset($_POST['submit']) && !isset($_POST['version2'])) {
@@ -147,7 +153,8 @@  discard block
 block discarded – undo
147 153
 
148 154
                     $desc = processEditorInput($oldDescMode, $descMode, $desc);
149 155
 
150
-                    if (isset($_POST['submitform']))  // Ocprop
156
+                    if (isset($_POST['submitform'])) {
157
+                        // Ocprop
151 158
                     {
152 159
                         // prüfen, ob sprache nicht schon vorhanden
153 160
                         $rs = sql(
@@ -160,6 +167,7 @@  discard block
 block discarded – undo
160 167
                             $descid,
161 168
                             $desclang
162 169
                         );
170
+                    }
163 171
                         $r = sql_fetch_array($rs);
164 172
                         if ($r['count'] > 0) {
165 173
                             tpl_errorMsg('editdesc', $error_desc_exists);
@@ -224,8 +232,7 @@  discard block
 block discarded – undo
224 232
 
225 233
                     if ($oldDescMode == 0) {
226 234
                         $desc = processEditorInput($oldDescMode, $descMode, $desc_record['desc']);
227
-                    }
228
-                    else {
235
+                    } else {
229 236
                         $desc = $desc_record['desc'];
230 237
                     }
231 238
                 }
Please login to merge, or discard this patch.
htdocs/resource2/tinymce/config/log.js.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
   if (isset($_REQUEST['lang'])) {
3 3
     $lang = $_REQUEST['lang'];
4
-  }
5
-  else {
4
+  } else {
6 5
     $lang = 'de';
7 6
   }
8 7
 ?>
Please login to merge, or discard this patch.
htdocs/resource2/tinymce/config/desc.js.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,14 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
   if (isset($_REQUEST['cacheid'])) {
3 3
     $cacheID = $_REQUEST['cacheid'];
4
-  }
5
-  else {
4
+  } else {
6 5
     $cacheID = 0;
7 6
   }
8 7
   if (isset($_REQUEST['lang'])) {
9 8
     $lang = $_REQUEST['lang'];
10
-  }
11
-  else {
9
+  } else {
12 10
     $lang = 'de';
13 11
   }
14 12
 ?>
Please login to merge, or discard this patch.
htdocs/resource2/tinymce/config/user.js.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2
-  if (isset($_REQUEST['lang']))
3
-    $lang = $_REQUEST['lang'];
4
-  else
5
-    $lang = 'de';
6
-?>
2
+  if (isset($_REQUEST['lang'])) {
3
+      $lang = $_REQUEST['lang'];
4
+  } else {
5
+      $lang = 'de';
6
+  }
7
+  ?>
7 8
 
8 9
 tinyMCE_GZ.init({
9 10
     plugins : 'advhr,contextmenu,emotions,insertdatetime,paste,table',
Please login to merge, or discard this patch.
htdocs/mailto.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
 $text = isset($_REQUEST['text']) ? $_REQUEST['text'] : '';
56 56
 if (isset($_REQUEST['emailaddress'])) {
57 57
     $bEmailaddress = ($_REQUEST['emailaddress'] == 1);
58
-}
59
-else {
58
+} else {
60 59
     $own_user = new user($login->userid);
61 60
     $bEmailaddress = $own_user->getUsermailSendAddress();
62 61
 }
Please login to merge, or discard this patch.
htdocs/lib2/db.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -894,8 +894,9 @@
 block discarded – undo
894 894
     }
895 895
 
896 896
     if ($db['dblink_slave'] !== false) {
897
-        if (mysql_select_db($opt['db']['placeholder']['db'], $db['dblink_slave']) == false)
898
-            sql_error();
897
+        if (mysql_select_db($opt['db']['placeholder']['db'], $db['dblink_slave']) == false) {
898
+                    sql_error();
899
+        }
899 900
 
900 901
         mysql_query("SET NAMES '" . mysql_real_escape_string($opt['charset']['mysql'], $db['dblink_slave']) . "'", $db['dblink_slave']);
901 902
 
Please login to merge, or discard this patch.
htdocs/okapi/services/replicate/changelog.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,13 +29,18 @@
 block discarded – undo
29 29
         require_once('replicate_common.inc.php');
30 30
 
31 31
         $since = $request->get_parameter('since');
32
-        if ($since === null) throw new ParamMissing('since');
33
-        if ((int)$since != $since) throw new InvalidParam('since');
32
+        if ($since === null) {
33
+            throw new ParamMissing('since');
34
+        }
35
+        if ((int)$since != $since) {
36
+            throw new InvalidParam('since');
37
+        }
34 38
 
35 39
         # Let's check the $since parameter.
36 40
 
37
-        if (!ReplicateCommon::check_since_param($since))
38
-            throw new BadRequest("The 'since' parameter is too old. You must update your database more frequently.");
41
+        if (!ReplicateCommon::check_since_param($since)) {
42
+                    throw new BadRequest("The 'since' parameter is too old. You must update your database more frequently.");
43
+        }
39 44
 
40 45
         # Select a best chunk for the given $since, get the chunk from the database (or cache).
41 46
 
Please login to merge, or discard this patch.
htdocs/okapi/services/logs/entry.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,16 +21,21 @@
 block discarded – undo
21 21
     public static function call(OkapiRequest $request)
22 22
     {
23 23
         $log_uuid = $request->get_parameter('log_uuid');
24
-        if (!$log_uuid) throw new ParamMissing('log_uuid');
24
+        if (!$log_uuid) {
25
+            throw new ParamMissing('log_uuid');
26
+        }
25 27
         $fields = $request->get_parameter('fields');
26
-        if (!$fields) $fields = "date|user|type|comment";
28
+        if (!$fields) {
29
+            $fields = "date|user|type|comment";
30
+        }
27 31
 
28 32
         $results = OkapiServiceRunner::call('services/logs/entries', new OkapiInternalRequest(
29 33
             $request->consumer, $request->token, array('log_uuids' => $log_uuid,
30 34
             'fields' => $fields)));
31 35
         $result = $results[$log_uuid];
32
-        if ($result == null)
33
-            throw new InvalidParam('log_uuid', "This log entry does not exist.");
36
+        if ($result == null) {
37
+                    throw new InvalidParam('log_uuid', "This log entry does not exist.");
38
+        }
34 39
         return Okapi::formatted_response($request, $result);
35 40
     }
36 41
 }
Please login to merge, or discard this patch.
htdocs/okapi/services/logs/logs.php 1 patch
Braces   +24 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,19 +24,31 @@  discard block
 block discarded – undo
24 24
     public static function call(OkapiRequest $request)
25 25
     {
26 26
         $cache_code = $request->get_parameter('cache_code');
27
-        if (!$cache_code) throw new ParamMissing('cache_code');
27
+        if (!$cache_code) {
28
+            throw new ParamMissing('cache_code');
29
+        }
28 30
         $fields = $request->get_parameter('fields');
29
-        if (!$fields) $fields = "uuid|date|user|type|comment";
31
+        if (!$fields) {
32
+            $fields = "uuid|date|user|type|comment";
33
+        }
30 34
 
31 35
         $offset = $request->get_parameter('offset');
32
-        if (!$offset) $offset = "0";
33
-        if ((((int)$offset) != $offset) || ((int)$offset) < 0)
34
-            throw new InvalidParam('offset', "Expecting non-negative integer.");
36
+        if (!$offset) {
37
+            $offset = "0";
38
+        }
39
+        if ((((int)$offset) != $offset) || ((int)$offset) < 0) {
40
+                    throw new InvalidParam('offset', "Expecting non-negative integer.");
41
+        }
35 42
         $limit = $request->get_parameter('limit');
36
-        if (!$limit) $limit = "none";
37
-        if ($limit == "none") $limit = "999999999";
38
-        if ((((int)$limit) != $limit) || ((int)$limit) < 0)
39
-            throw new InvalidParam('limit', "Expecting non-negative integer or 'none'.");
43
+        if (!$limit) {
44
+            $limit = "none";
45
+        }
46
+        if ($limit == "none") {
47
+            $limit = "999999999";
48
+        }
49
+        if ((((int)$limit) != $limit) || ((int)$limit) < 0) {
50
+                    throw new InvalidParam('limit', "Expecting non-negative integer or 'none'.");
51
+        }
40 52
 
41 53
         # Check if code exists and retrieve cache ID (this will throw
42 54
         # a proper exception on invalid code).
@@ -64,8 +76,9 @@  discard block
 block discarded – undo
64 76
         $internal_request->skip_limits = true;
65 77
         $logs = OkapiServiceRunner::call('services/logs/entries', $internal_request);
66 78
         $results = array();
67
-        foreach ($log_uuids as $log_uuid)
68
-            $results[] = $logs[$log_uuid];
79
+        foreach ($log_uuids as $log_uuid) {
80
+                    $results[] = $logs[$log_uuid];
81
+        }
69 82
 
70 83
         /* Handle OCPL's "access logs" feature. */
71 84
 
Please login to merge, or discard this patch.