title: calling a function within a class with a Joomla module
body: <p>I have a Joomla helper class that I'm using for module development with a method I'm trying to call:</p>
  
  <pre><code>class modCamcloudReferralHelper
  {
          /*
           * Sanitize email form
           */
          public function isInjected($str) {
              $inject = "/(\r|\t|%0A|%0D|%08|%09)+/i";
              return (preg_match($inject, $str) &gt; 0);
          }
  
          public static function sendEmail() {
  
  
              $jinput = JFactory::getApplication()-&gt;input;
  
              $email = $jinput-&gt;post-&gt;get('email', '', 'STRING');
  
  
              //check email is fine
              if (isInjected($email)){ //never get into this code and it causes some sort of failure
                  echo "blah";
              }
  
          }
  }
  </code></pre>
  
  <p>Simple, right? But this code just gives me a blank page and I don't see any errors...anywhere. I can instead just put this code right into my <code>sendEmail</code> function and it works just fine:</p>
  
  <pre><code>        $inject = "/(\r|\t|%0A|%0D|%08|%09)+/i";
          if (preg_match($inject, $email) &gt; 0){
              echo "This works";
          }
  </code></pre>
  
  <p>I've had this problem with my Joomla components I've built before. For some reason calling this function from inside the same class is not working. It must be a Joomla thing...or I'm going nuts. Any ideas?</p>