Permalink
Browse files

forgot to git add the ascii login hook

  • Loading branch information...
1 parent b0fd1f0 commit bb513be3eb2c92b634895f7ab0e2cf9d8f7617cf @kerphi committed Nov 1, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 server/contrib/ascii-login/pfc-hook.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ * phpfreechat hook used to filter login which are note ascii
+ */
+
+ $GLOBALS['pfc_hooks']['pfc.filter.login'][5] = function ($app, $req, $res) {
+ return function ($login) use ($app, $req, $res) {
+ $ascii_pattern = '/[^a-z0-9()\/\'"|&,. -]/i';
+ return preg_replace($ascii_pattern, '', $login);
+ };
+};

0 comments on commit bb513be

Please sign in to comment.