Completed
Pull Request — master (#28)
by rugk
02:50
created
samples/web/include/Connection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
  *
19 19
  * @return Connection $connector
20 20
  */
21
-function CreateConnection($keystorePath='../../keystore.php', $useTlsOptions=true)
21
+function CreateConnection($keystorePath = '../../keystore.php', $useTlsOptions = true)
22 22
 {
23 23
     $publicKeyStore = CreatePublicKeyStore($keystorePath);
24 24
     $settings = CreateConnectionSettings($publicKeyStore, $useTlsOptions);
Please login to merge, or discard this patch.
samples/web/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $fileConnCredentErr .= ' Not all required constants are defined.';
60 60
     } else {
61 61
         if (MSGAPI_GATEWAY_THREEMA_ID == '' ||
62
-            !preg_match('/' . REGEXP_THREEMAID_GATEWAY . '/', MSGAPI_GATEWAY_THREEMA_ID)
62
+            !preg_match('/'.REGEXP_THREEMAID_GATEWAY.'/', MSGAPI_GATEWAY_THREEMA_ID)
63 63
         ) {
64 64
             $fileConnCredentErr .= ' \'MSGAPI_GATEWAY_THREEMA_ID\' is invalid.';
65 65
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         }
77 77
 
78 78
         if (MSGAPI_DEFAULTRECEIVER <> '' &&
79
-            !preg_match('/' . REGEXP_THREEMAID_ANY . '/', MSGAPI_DEFAULTRECEIVER)
79
+            !preg_match('/'.REGEXP_THREEMAID_ANY.'/', MSGAPI_DEFAULTRECEIVER)
80 80
         ) {
81 81
             $fileConnCredentErr .= ' \'MSGAPI_DEFAULTRECEIVER\' is invalid.';
82 82
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             <!-- files already exist - no need to show instructions -->
135 135
         <?php else: ?>
136 136
         <p>
137
-            Before you can use this test you have to get credentials at <a href="https://gateway.threema.ch" title="Threema Gateway">gateway.threema.ch</a> and <a href="https://github.com/rugk/threema-msgapi-sdk-php/wiki/How-to-generate-a-new-key-pair-and-send-a-message">create a key pair</a>. After you did so, you have to open <code><?php echo FILENAME_CONNCRED . FILEEXT_EXAMPLE ?></code> and <code><?php echo FILENAME_PRIVKEY . FILEEXT_EXAMPLE ?></code> and add your credentials and private key. Save them without the <code><?php echo FILEEXT_EXAMPLE ?></code> file extension afterwards.
137
+            Before you can use this test you have to get credentials at <a href="https://gateway.threema.ch" title="Threema Gateway">gateway.threema.ch</a> and <a href="https://github.com/rugk/threema-msgapi-sdk-php/wiki/How-to-generate-a-new-key-pair-and-send-a-message">create a key pair</a>. After you did so, you have to open <code><?php echo FILENAME_CONNCRED.FILEEXT_EXAMPLE ?></code> and <code><?php echo FILENAME_PRIVKEY.FILEEXT_EXAMPLE ?></code> and add your credentials and private key. Save them without the <code><?php echo FILEEXT_EXAMPLE ?></code> file extension afterwards.
138 138
             By default these files are excluded from git pulls so you will not accidentally publish these sensitive files.
139 139
         </p>
140 140
         <?php endif ?>
@@ -221,9 +221,9 @@  discard block
 block discarded – undo
221 221
                     </fieldset>
222 222
                     <fieldset id="field_method">
223 223
                         <legend>Method</legend>
224
-                        <input id="SrvMethodGet" name="servermethod" type="radio" <?php if ($_SERVER['REQUEST_METHOD'] == 'GET') {echo 'checked="checked"';}?> value="get">
224
+                        <input id="SrvMethodGet" name="servermethod" type="radio" <?php if ($_SERVER['REQUEST_METHOD'] == 'GET') {echo 'checked="checked"'; }?> value="get">
225 225
                             <label for="SrvMethodGet">GET</label>
226
-                        <input id="SrvMethodPost" name="servermethod" type="radio" <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') {echo 'checked="checked"';}?> value="post">
226
+                        <input id="SrvMethodPost" name="servermethod" type="radio" <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') {echo 'checked="checked"'; }?> value="post">
227 227
                             <label for="SrvMethodPost">POST</label>
228 228
                         <br />
229 229
                         <input id="ButtonExternalScript" name="isExternal" type="checkbox">
Please login to merge, or discard this patch.
samples/web/SendTextMessage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 //get params
52 52
 if (ReturnGetPost('recieverid') &&
53
-    preg_match('/' . REGEXP_THREEMAID_ANY . '/', ReturnGetPost('recieverid'))
53
+    preg_match('/'.REGEXP_THREEMAID_ANY.'/', ReturnGetPost('recieverid'))
54 54
 ) {
55 55
     $threemaId = htmlentities(ReturnGetPost('recieverid'));
56 56
     $message = ReturnGetPost('message');
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 //Show direct output if the file is called directly
78 78
 if (!$isIncluded) {
79 79
     if ($errorMessage == null) {
80
-        echo 'Message ID: ' . $messageId;
80
+        echo 'Message ID: '.$messageId;
81 81
     } else {
82 82
         echo $errorMessage;
83 83
     }
Please login to merge, or discard this patch.
samples/web/FetchPublicKey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 //get params
44 44
 $threemaId = null;
45 45
 if (ReturnGetPost('threemaid') &&
46
-    preg_match('/' . REGEXP_THREEMAID_ANY . '/', ReturnGetPost('threemaid'))
46
+    preg_match('/'.REGEXP_THREEMAID_ANY.'/', ReturnGetPost('threemaid'))
47 47
 ) {
48 48
     $threemaId = htmlentities(ReturnGetPost('threemaid'));
49 49
 }
Please login to merge, or discard this patch.
samples/web/SendE2EText.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@
 block discarded – undo
40 40
 
41 41
     //show result
42 42
     if (true === $result->isSuccess()) {
43
-    	echo 'Message ID: '.$result->getMessageId() . "\n";
43
+    	echo 'Message ID: '.$result->getMessageId()."\n";
44 44
     } else {
45
-    	echo 'Error: '.$result->getErrorMessage() . "\n";
45
+    	echo 'Error: '.$result->getErrorMessage()."\n";
46 46
     }
47 47
 
48 48
 }
Please login to merge, or discard this patch.
samples/web/include/PublicKey.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 function KeyCheck($publicKey, $suffix = '')
16 16
 {
17 17
     // RegExp: https://regex101.com/r/sU5tC8/1
18
-    return preg_match('/^(' . $suffix . ')?[[:alnum:]]{64}$/', $publicKey);
18
+    return preg_match('/^('.$suffix.')?[[:alnum:]]{64}$/', $publicKey);
19 19
 }
20 20
 
21 21
 /**
Please login to merge, or discard this patch.