Index: trunk/extensions/QrCode/QrCode.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | $wgExtensionCredits['parserhook'][] = array( |
24 | 24 | 'path' => __FILE__, |
25 | 25 | 'name' => 'QrCode', |
26 | | - 'version' => '0.09', |
| 26 | + 'version' => '0.10', |
27 | 27 | 'author' => array( 'David Raison' ), |
28 | 28 | 'url' => 'http://www.mediawiki.org/wiki/Extension:QrCode', |
29 | 29 | 'descriptionmsg' => 'qrcode-desc' |
— | — | @@ -120,8 +120,8 @@ |
121 | 121 | * first generate then publish it. |
122 | 122 | */ |
123 | 123 | public function showCode( $label = false ){ |
| 124 | + |
124 | 125 | // Check for a provided label and use the page URL as default. |
125 | | - // Also strip all non-alphanumeric characters |
126 | 126 | if ( $label ) { |
127 | 127 | $this->_label = $label; // cannot remember why sanitizing this would make sense |
128 | 128 | //$this->_label = preg_replace("/[^0-9a-zA-Z_]+/", "", $label); |
— | — | @@ -140,7 +140,8 @@ |
141 | 141 | return $this->_displayImage( $file ); |
142 | 142 | } else { |
143 | 143 | wfDebug( "QrCode::showCode: Requested file ".$this->_dstFileName." is new and needs to be generated.\n"); |
144 | | - return $this->_generate(); |
| 144 | + $this->_generate(); |
| 145 | + return; |
145 | 146 | } |
146 | 147 | } |
147 | 148 | |
— | — | @@ -181,6 +182,7 @@ |
182 | 183 | |
183 | 184 | |
184 | 185 | public function __construct( $title, $params, $id = 0 ) { |
| 186 | + wfDebug("QrCodeDebug::Creating Job\n"); |
185 | 187 | $this->_dstFileName = $params['dstName']; |
186 | 188 | $this->_tmpName = $params['tmpName']; |
187 | 189 | $this->_uploadComment = $params['comment']; |
— | — | @@ -196,8 +198,11 @@ |
197 | 199 | global $wgOut; |
198 | 200 | |
199 | 201 | $mUpload = new UploadFromFile(); |
200 | | - $mUpload->initialize( $this->_dstFileName, $this->_tmpName, null ); // we don't know the filesize, how could we? |
201 | | - |
| 202 | + |
| 203 | + wfDebug("QrCodeDebug::".$this->_dstFileName." ".$this->_tmpName."\n"); |
| 204 | + // $mUpload->initialize( $this->_dstFileName, $this->_tmpName, null ); // pre 1.17 |
| 205 | + $mUpload->initializePathInfo( $this->_dstFileName, $this->_tmpName, null ); // we don't know the filesize, how could we? |
| 206 | + wfDebug("QrCodeDebug:: Intialization finished\n"); |
202 | 207 | $pageText = 'QrCode '.$this->_dstFileName.', generated on '.date( "r" ) |
203 | 208 | .' by the QrCode Extension for page [['.$this->title->getFullText().']].'; |
204 | 209 | |