@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | } |
97 | 97 | if (is_null($currentAction) && $auth && $user->perm->checkRight($user->getUserId(), 'addattachment')) { |
98 | - $recordId = filter_input(INPUT_GET, 'record_id', FILTER_VALIDATE_INT); |
|
98 | + $recordId = filter_input(INPUT_GET, 'record_id', FILTER_VALIDATE_INT); |
|
99 | 99 | $recordLang = filter_input(INPUT_GET, 'record_lang', FILTER_SANITIZE_STRING); |
100 | 100 | ?> |
101 | 101 | <form action="attachment.php?action=save" enctype="multipart/form-data" method="post" accept-charset="utf-8"> |
102 | 102 | <fieldset> |
103 | 103 | <legend> |
104 | 104 | <?php echo $PMF_LANG['ad_att_addto'].' '.$PMF_LANG['ad_att_addto_2'] ?> |
105 | - (max <?php echo round($faqConfig->get('records.maxAttachmentSize') / pow(1024, 2), 2) ?> MB) |
|
105 | + (max <?php echo round($faqConfig->get('records.maxAttachmentSize')/pow(1024, 2), 2) ?> MB) |
|
106 | 106 | </legend> |
107 | 107 | <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $faqConfig->get('records.maxAttachmentSize') ?>"> |
108 | 108 | <input type="hidden" name="record_id" value="<?php echo $recordId ?>"> |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | if (!is_null($currentSave) && $currentSave == true && $auth && |
134 | 134 | $user->perm->checkRight($user->getUserId(), 'addattachment')) { |
135 | - $recordId = filter_input(INPUT_POST, 'record_id', FILTER_VALIDATE_INT); |
|
135 | + $recordId = filter_input(INPUT_POST, 'record_id', FILTER_VALIDATE_INT); |
|
136 | 136 | $recordLang = filter_input(INPUT_POST, 'record_lang', FILTER_SANITIZE_STRING); |
137 | 137 | ?> |
138 | 138 | <p> |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | '<p>%s</p>', |
175 | 175 | sprintf( |
176 | 176 | $PMF_LANG['ad_attach_4'], |
177 | - round($faqConfig->get('records.maxAttachmentSize') / pow(1024, 2), 2) |
|
177 | + round($faqConfig->get('records.maxAttachmentSize')/pow(1024, 2), 2) |
|
178 | 178 | ) |
179 | 179 | ); |
180 | 180 |
@@ -638,14 +638,14 @@ discard block |
||
638 | 638 | $PMF_LANG["ad_entry_visibility"] = "sichtbar"; |
639 | 639 | |
640 | 640 | // added v2.0.0 - 2006-01-02 by Lars |
641 | -$PMF_LANG["ad_user_error_password"] = "Bitte geben Sie ein Passwort ein. "; |
|
642 | -$PMF_LANG["ad_user_error_passwordsDontMatch"] = "Die Passwörter stimmen nicht überein. "; |
|
643 | -$PMF_LANG["ad_user_error_loginInvalid"] = "Der ausgewählte Benutzer ist ungültig."; |
|
644 | -$PMF_LANG["ad_user_error_noEmail"] = "Bitte geben Sie eine korrekte E-Mailadresse ein. "; |
|
645 | -$PMF_LANG["ad_user_error_noRealName"] = "Bitte geben Sie ihren Namen ein. "; |
|
646 | -$PMF_LANG["ad_user_error_delete"] = "Der Benutzeraccount kann nicht gelöscht werden. "; |
|
647 | -$PMF_LANG["ad_user_error_noId"] = "Keine ID ausgewählt. "; |
|
648 | -$PMF_LANG["ad_user_error_protectedAccount"] = "Der Benutzeraccount ist geschützt. "; |
|
641 | +$PMF_LANG["ad_user_error_password"] = "Bitte geben Sie ein Passwort ein. "; |
|
642 | +$PMF_LANG["ad_user_error_passwordsDontMatch"] = "Die Passwörter stimmen nicht überein. "; |
|
643 | +$PMF_LANG["ad_user_error_loginInvalid"] = "Der ausgewählte Benutzer ist ungültig."; |
|
644 | +$PMF_LANG["ad_user_error_noEmail"] = "Bitte geben Sie eine korrekte E-Mailadresse ein. "; |
|
645 | +$PMF_LANG["ad_user_error_noRealName"] = "Bitte geben Sie ihren Namen ein. "; |
|
646 | +$PMF_LANG["ad_user_error_delete"] = "Der Benutzeraccount kann nicht gelöscht werden. "; |
|
647 | +$PMF_LANG["ad_user_error_noId"] = "Keine ID ausgewählt. "; |
|
648 | +$PMF_LANG["ad_user_error_protectedAccount"] = "Der Benutzeraccount ist geschützt. "; |
|
649 | 649 | $PMF_LANG["ad_user_deleteUser"] = "Lösche Benutzer"; |
650 | 650 | $PMF_LANG["ad_user_status"] = "Status"; |
651 | 651 | $PMF_LANG["ad_user_lastModified"] = "Letzte Änderung:"; |
@@ -975,9 +975,9 @@ discard block |
||
975 | 975 | $PMF_LANG["ad_record_active"] = "aktiviert"; |
976 | 976 | |
977 | 977 | // added 2.6.0-alpha - 2009-11-02 by max |
978 | -$LANG_CONF["search.numberSearchTerms"] = array(0 => "input", 1 => "Anzahl der beliebtesten Suchbegriffe"); |
|
978 | +$LANG_CONF["search.numberSearchTerms"] = array(0 => "input", 1 => "Anzahl der beliebtesten Suchbegriffe"); |
|
979 | 979 | $LANG_CONF["records.orderingPopularFaqs"] = array(0 => "select", 1 => "Sortierung der TOP-FAQ"); |
980 | -$PMF_LANG["list_all_users"] = "Alle Benutzer anzeigen"; |
|
980 | +$PMF_LANG["list_all_users"] = "Alle Benutzer anzeigen"; |
|
981 | 981 | |
982 | 982 | $PMF_LANG["records.orderingPopularFaqs.visits"] = "nach Anzahl der Besucher"; |
983 | 983 | $PMF_LANG["records.orderingPopularFaqs.voting"] = "nach Bewertung der Besucher"; |
@@ -36,47 +36,47 @@ discard block |
||
36 | 36 | } |
37 | 37 | switch ($ajaxAction) { |
38 | 38 | |
39 | - case 'upload': |
|
39 | + case 'upload': |
|
40 | 40 | |
41 | - $uploadDir = PMF_ROOT_DIR . '/images/'; |
|
42 | - $uploadFile = basename($_FILES['upload']['name']); |
|
43 | - $isUploaded = false; |
|
44 | - $height = $width = 0; |
|
45 | - $validFileExtensions = [ 'gif', 'jpg', 'jpeg', 'png' ]; |
|
41 | + $uploadDir = PMF_ROOT_DIR . '/images/'; |
|
42 | + $uploadFile = basename($_FILES['upload']['name']); |
|
43 | + $isUploaded = false; |
|
44 | + $height = $width = 0; |
|
45 | + $validFileExtensions = [ 'gif', 'jpg', 'jpeg', 'png' ]; |
|
46 | 46 | |
47 | - if ($csrfOkay) { |
|
48 | - if (is_uploaded_file($uploadedFile['tmp_name']) && |
|
49 | - $uploadedFile['size'] < $faqConfig->get('records.maxAttachmentSize') |
|
50 | - ) { |
|
47 | + if ($csrfOkay) { |
|
48 | + if (is_uploaded_file($uploadedFile['tmp_name']) && |
|
49 | + $uploadedFile['size'] < $faqConfig->get('records.maxAttachmentSize') |
|
50 | + ) { |
|
51 | 51 | |
52 | - $fileInfo = getimagesize($uploadedFile['tmp_name']); |
|
53 | - $fileExtension = pathinfo($uploadFile, PATHINFO_EXTENSION);; |
|
52 | + $fileInfo = getimagesize($uploadedFile['tmp_name']); |
|
53 | + $fileExtension = pathinfo($uploadFile, PATHINFO_EXTENSION);; |
|
54 | 54 | |
55 | - if (false === $fileInfo) { |
|
56 | - $isUploaded = false; |
|
57 | - } |
|
58 | - |
|
59 | - if (($fileInfo[2] !== IMAGETYPE_GIF) && |
|
60 | - ($fileInfo[2] !== IMAGETYPE_JPEG) && |
|
61 | - ($fileInfo[2] !== IMAGETYPE_PNG)) { |
|
62 | - $isUploaded = false; |
|
63 | - } else { |
|
64 | - $isUploaded = true; |
|
65 | - } |
|
66 | - |
|
67 | - if (!in_array($fileExtension, $validFileExtensions)) { |
|
68 | - $isUploaded = false; |
|
69 | - } |
|
55 | + if (false === $fileInfo) { |
|
56 | + $isUploaded = false; |
|
57 | + } |
|
70 | 58 | |
71 | - if ($fileInfo && $isUploaded) { |
|
72 | - list($width, $height) = $fileInfo; |
|
73 | - if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir . $uploadFile)) { |
|
74 | - $isUploaded = true; |
|
59 | + if (($fileInfo[2] !== IMAGETYPE_GIF) && |
|
60 | + ($fileInfo[2] !== IMAGETYPE_JPEG) && |
|
61 | + ($fileInfo[2] !== IMAGETYPE_PNG)) { |
|
62 | + $isUploaded = false; |
|
75 | 63 | } else { |
64 | + $isUploaded = true; |
|
65 | + } |
|
66 | + |
|
67 | + if (!in_array($fileExtension, $validFileExtensions)) { |
|
76 | 68 | $isUploaded = false; |
77 | 69 | } |
78 | - } |
|
79 | - ?> |
|
70 | + |
|
71 | + if ($fileInfo && $isUploaded) { |
|
72 | + list($width, $height) = $fileInfo; |
|
73 | + if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir . $uploadFile)) { |
|
74 | + $isUploaded = true; |
|
75 | + } else { |
|
76 | + $isUploaded = false; |
|
77 | + } |
|
78 | + } |
|
79 | + ?> |
|
80 | 80 | <script> |
81 | 81 | window.parent.window.pmfImageUpload.uploadFinished({ |
82 | 82 | filename: '<?php echo $faqConfig->getDefaultUrl() . 'images/' . $uploadFile ?>', |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | }); |
88 | 88 | </script> |
89 | 89 | <?php |
90 | - } else { |
|
91 | - ?> |
|
90 | + } else { |
|
91 | + ?> |
|
92 | 92 | <script> |
93 | 93 | window.parent.window.pmfImageUpload.uploadFinished({ |
94 | 94 | filename: '', |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | }); |
100 | 100 | </script> |
101 | 101 | <?php |
102 | - } |
|
103 | - } else { |
|
104 | - ?> |
|
102 | + } |
|
103 | + } else { |
|
104 | + ?> |
|
105 | 105 | <script> |
106 | 106 | window.parent.window.pmfImageUpload.uploadFinished({ |
107 | 107 | filename: '', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | }); |
113 | 113 | </script> |
114 | 114 | <?php |
115 | - } |
|
115 | + } |
|
116 | 116 | |
117 | - break; |
|
117 | + break; |
|
118 | 118 | } |
119 | 119 | \ No newline at end of file |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | |
39 | 39 | case 'upload': |
40 | 40 | |
41 | - $uploadDir = PMF_ROOT_DIR . '/images/'; |
|
41 | + $uploadDir = PMF_ROOT_DIR.'/images/'; |
|
42 | 42 | $uploadFile = basename($_FILES['upload']['name']); |
43 | 43 | $isUploaded = false; |
44 | 44 | $height = $width = 0; |
45 | - $validFileExtensions = [ 'gif', 'jpg', 'jpeg', 'png' ]; |
|
45 | + $validFileExtensions = ['gif', 'jpg', 'jpeg', 'png']; |
|
46 | 46 | |
47 | 47 | if ($csrfOkay) { |
48 | 48 | if (is_uploaded_file($uploadedFile['tmp_name']) && |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | ) { |
51 | 51 | |
52 | 52 | $fileInfo = getimagesize($uploadedFile['tmp_name']); |
53 | - $fileExtension = pathinfo($uploadFile, PATHINFO_EXTENSION);; |
|
53 | + $fileExtension = pathinfo($uploadFile, PATHINFO_EXTENSION); ; |
|
54 | 54 | |
55 | 55 | if (false === $fileInfo) { |
56 | 56 | $isUploaded = false; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | if ($fileInfo && $isUploaded) { |
72 | 72 | list($width, $height) = $fileInfo; |
73 | - if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir . $uploadFile)) { |
|
73 | + if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir.$uploadFile)) { |
|
74 | 74 | $isUploaded = true; |
75 | 75 | } else { |
76 | 76 | $isUploaded = false; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ?> |
80 | 80 | <script> |
81 | 81 | window.parent.window.pmfImageUpload.uploadFinished({ |
82 | - filename: '<?php echo $faqConfig->getDefaultUrl() . 'images/' . $uploadFile ?>', |
|
82 | + filename: '<?php echo $faqConfig->getDefaultUrl().'images/'.$uploadFile ?>', |
|
83 | 83 | result: '<?php echo $isUploaded ? 'file_uploaded' : 'error' ?>', |
84 | 84 | resultCode: '<?php echo $isUploaded ? 'success' : 'failed' ?>', |
85 | 85 | height: <?php echo $height ?>, |
@@ -124,7 +124,7 @@ |
||
124 | 124 | foreach ($attributes[0] as $attribute) { |
125 | 125 | $attributeName = stristr($attribute, '=', true); |
126 | 126 | if (!in_array($attributeName, $keep)) { |
127 | - $html = str_replace(' ' . $attribute, '', $html); |
|
127 | + $html = str_replace(' '.$attribute, '', $html); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 |
@@ -62,9 +62,12 @@ |
||
62 | 62 | <input type="hidden" name="showcat" value="<?php echo $showcat ?>"> |
63 | 63 | <?php if ($faqConfig->get('security.permLevel') !== 'basic'): ?> |
64 | 64 | <input type="hidden" name="restricted_groups[]" value="<?php echo $group_permission[0] ?>"> |
65 | - <?php else: ?> |
|
65 | + <?php else { |
|
66 | + : ?> |
|
66 | 67 | <input type="hidden" name="restricted_groups[]" value="-1"> |
67 | - <?php endif; ?> |
|
68 | + <?php endif; |
|
69 | +} |
|
70 | +?> |
|
68 | 71 | <input type="hidden" name="restricted_users" value="<?php echo $user_permission[0] ?>"> |
69 | 72 | <input type="hidden" name="csrf" value="<?php echo $user->getCsrfTokenFromSession() ?>"> |
70 | 73 | <input type="hidden" name="active" value="<?php echo $category->categoryName[$id]['active'] ?>"> |
@@ -15,7 +15,6 @@ |
||
15 | 15 | * @author Matteo Scaramuccia <[email protected]> |
16 | 16 | * @copyright 2009-2018 phpMyFAQ Team |
17 | 17 | * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
18 | - |
|
19 | 18 | * @link http://www.phpmyfaq.de |
20 | 19 | * @since 2009-09-24 |
21 | 20 | */ |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if ('medium' === $this->_config->get('security.permLevel')) { |
125 | 125 | $groupPermissions = $this->faq->getPermission('group', $result->id); |
126 | 126 | if (is_array($groupPermissions)) { |
127 | - foreach($groupPermissions as $permission) { |
|
127 | + foreach ($groupPermissions as $permission) { |
|
128 | 128 | if (in_array($permission, $currentGroupIds)) { |
129 | 129 | $permission = true; |
130 | 130 | } |
@@ -222,6 +222,6 @@ discard block |
||
222 | 222 | $score += $object->relevance_keywords; |
223 | 223 | } |
224 | 224 | |
225 | - return round($score / 3 * 100); |
|
225 | + return round($score/3*100); |
|
226 | 226 | } |
227 | 227 | } |