Commit 666cb6a3 authored by Rigel Kent's avatar Rigel Kent
Browse files

fix carriage return when parsing category

fixes #3
parent 622ace9e
Pipeline #121642 passed with stage
in 45 seconds
...@@ -135,7 +135,7 @@ class ReadNotificationsCommand extends Command ...@@ -135,7 +135,7 @@ class ReadNotificationsCommand extends Command
//An account asks for help //An account asks for help
} else if( count($tags) == 0 && (strpos(strtolower($content), 'help') !== false )){ } else if( count($tags) == 0 && (strpos(strtolower($content), 'help') !== false )){
$messages[$messageCount] = "Hello @".$account['acct'].", here is how I work: \r\n\r\n"; $messages[$messageCount] = "Hello @".$account['acct'].", here is how I work: \r\n\r\n";
$messages[$messageCount] .= "To get the latest papers:\r\n- mention me with a query: an arXiv category ('cs', 'math', etc.)\r\n- optionally add the number of papers you want\r\n\r\n"; $messages[$messageCount] .= "To get the latest papers:\r\n- mention me with a query: an arXiv category ('cs', 'physics', 'math', 'q-bio', 'q-fin', 'stat', 'eess', 'econ')\r\n- optionally add the number of papers you want\r\n\r\n";
//TODO $messages[$messageCount] .= "For subscription:\r\n- mention me your query only preceded by a time (ex: 0800 for 8am CET)\r\n\r\n"; //TODO $messages[$messageCount] .= "For subscription:\r\n- mention me your query only preceded by a time (ex: 0800 for 8am CET)\r\n\r\n";
//$messages[$messageCount] .= "For removing your data:\r\n- mention me with \"delete\" or \"remove\""; //$messages[$messageCount] .= "For removing your data:\r\n- mention me with \"delete\" or \"remove\"";
...@@ -155,8 +155,8 @@ class ReadNotificationsCommand extends Command ...@@ -155,8 +155,8 @@ class ReadNotificationsCommand extends Command
///////////////////////////////////////////// /////////////////////////////////////////////
/// Commands, beginning with known categories /// Commands, beginning with known categories
///////////////////////////////////////////// /////////////////////////////////////////////
} else if ( in_array($args[0], $this->arxivCategories) ) { } else if ( in_array(preg_replace('~[[:cntrl:]]~', '', $args[0]), $this->arxivCategories) ) {
$category = $args[0]; $category = preg_replace('~[[:cntrl:]]~', '', $args[0]);
try { try {
$redis->ping(); $redis->ping();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment