Skip to content

Commit aaddf55

Browse files
committed
Add username input sanitization script to profile views
1 parent e27d276 commit aaddf55

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

resources/views/layouts/app.blade.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,6 @@ class="hover:underline"
171171
</div>
172172
</div>
173173
</div>
174-
175-
<script lang="js">
176-
const usernameInput = (event) => {
177-
event.target.value = event.target.value.replaceAll(/[^a-zA-Z0-9_]/g, "_").toLowerCase()
178-
}
179-
</script>
180174
</body>
181175

182176
</html>

resources/views/livewire/profile.blade.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,10 @@ class="xs:max-w-30 ml-auto w-full text-xs/3"
163163
</x-button>
164164
</x-form>
165165
</div>
166+
167+
<script lang="js">
168+
const usernameInput = (event) => {
169+
event.target.value = event.target.value.replaceAll(/[^a-zA-Z0-9_]/g, "_").toLowerCase()
170+
}
171+
</script>
166172
</x-contents>

resources/views/livewire/users/profile.blade.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,10 @@ class="xs:max-w-30 ml-auto w-full text-xs/3"
141141
Delete Account
142142
</x-button>
143143
</div>
144+
145+
<script lang="js">
146+
const usernameInput = (event) => {
147+
event.target.value = event.target.value.replaceAll(/[^a-zA-Z0-9_]/g, "_").toLowerCase()
148+
}
149+
</script>
144150
</x-contents>

0 commit comments

Comments
 (0)