title: Returning results from a custom MediaWiki hook
body: <p>I'm hacking an existing MediaWiki extension, <a href="http://www.mediawiki.org/wiki/Extension%3aProcessCite" rel="nofollow">ProcessCite</a>, that adds a custom hook to the <a href="http://mediawiki.org/wiki/Extension%3aCite" rel="nofollow">Cite extension</a>. Since migrating to PHP 5.4 and MW 1.22 (from PHP 5.3 and MW 1.19.2), the extension does not appear to work correctly. The problem is with the custom hook not returning the data it should do.</p>
  
  <p>Here are the relevant parts of the code:</p>
  
  <p>ProcessCite.php </p>
  
  <pre><code># Declare the hook:
  $wgHooks['CiteBeforeStackEntry'][] = 'wfProcessCite';
  
  # the function itself
  function wfProcessCite($str, $argv){
  
  # process $argv and $str to create a new version of $str
  # $argv remains unchanged, $str is set to new value
    ...
    $str = "new string";
  
    return true;
  }
  </code></pre>
  
  <p>in Cite_body.php</p>
  
  <pre><code>function stack( $str, $key = null, $group, $follow, $call ) {
    # add the call to the CiteBeforeStackEntry hook
    wfRunHooks( 'CiteBeforeStackEntry', array( &amp;$str, &amp;$call ) );
  </code></pre>
  
  <p>I've added debugging statements to the beginning and end of <code>wfProcessCite</code>, which show that <code>$str</code> is being altered; however, debug statements before and after <code>wfRunHooks</code>show no change to <code>$str</code>.</p>
  
  <p>Can anyone help? </p>