{"action":"opened","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/9381","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9381/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9381/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9381/events","html_url":"https://github.com/joomla/joomla-cms/issues/9381","id":140303493,"number":9381,"title":"Blank system-messages","user":{"login":"sapphireweb","id":8951751,"avatar_url":"https://avatars.githubusercontent.com/u/8951751?v=3","gravatar_id":"","url":"https://api.github.com/users/sapphireweb","html_url":"https://github.com/sapphireweb","followers_url":"https://api.github.com/users/sapphireweb/followers","following_url":"https://api.github.com/users/sapphireweb/following{/other_user}","gists_url":"https://api.github.com/users/sapphireweb/gists{/gist_id}","starred_url":"https://api.github.com/users/sapphireweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapphireweb/subscriptions","organizations_url":"https://api.github.com/users/sapphireweb/orgs","repos_url":"https://api.github.com/users/sapphireweb/repos","events_url":"https://api.github.com/users/sapphireweb/events{/privacy}","received_events_url":"https://api.github.com/users/sapphireweb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-11T22:08:08Z","updated_at":"2016-03-11T22:08:08Z","closed_at":null,"body":"## ------------   Requested Change ----------- ##\r\n\r\nI am suggesting a very minor change to the /libraries/cms/application/cms.php file.  On line 230, \r\n\r\nif (!strlen($msg)) \r\n\r\nchanges to \r\n\r\nif (!strlen(trim($msg)))\r\n\r\n## ------------   Reason ----------- ##\r\n\r\nI had been having an issue on my site with tons of empty system-message-component in pages each with a hidden UL of 40 or more items, all blank, causing empty messages.  After some digging, I found the problem. In a debug_backtrace, under com_blankcomponent, in the _messageQueue[] I was finding up to 50 of the following:\r\n\r\n Array(\r\n   [message] => \r\n   [type] => message  ) \r\n\r\nIn examining the the code for com_blankcomponent, I could not find anything that was adding anything to the messageque.  After changing the if statement in cms.php, the problem was resolved.\r\n\r\n## ------------   Explanation / Hunch ----------- ##\r\n\r\nChecking to see if !strlen($msg)) is normally sufficient to avoid adding blank messages.  However if a component has a blank message, where the length is greater than 0, but is only whitespace it will still be added to the que.  By adding trm(), we strip out all the erogenous spaces and other whitespace characters before checking the length of the message. \r\n\r\n\r\n"}}