Browse the code

 

Differences between 481 and 482 on /.
Number of edited files: 4 (0 added, 0 deleted and 4 modified)
Revision 482

About 6 years and 11 months ago.

* Fixed #2734
Added file(s) Deleted file(s) Modified file(s)

 

Old New Code
242
242
    <td style="vertical-align:top;width: 67%;">
243
243
      <h4>'.i18n('Code').'</h4>
244
244
      <strong>'.$error[2].'</strong>
245
 
      <div class="errdebug">'.$code.'</div>
 
245
      <div class="errdebug" style="margin-top: -5px;">'.$code.'</div>
246
246
    </td>
247
247
    <td style="vertical-align:top;">
248
248
      <h4>'.i18n('Memory dump').'</h4>
249
 
      <textarea cols="40" rows="12" readonly="readonly" style="width: 98%;">'.
 
249
      <strong>PHP '.PHP_VERSION.' ('.PHP_OS.')</strong>
 
250
      <textarea cols="40" rows="10" readonly="readonly" style="width: 98%;height: 159px;">'.
250
251
      $datas.'</textarea>
251
252
    </td>
252
253
  </tr>
255
256
<p style="clear: both;">&nbsp;</p>
256
257

                                        
257
258
<div style="background-image: url(\''.$dbimg.'\');background-repeat: '.
258
 
  'no-repeat;padding-left: 20px;height: 18px;">
 
259
  'no-repeat;padding-left: 20px;padding-top: 1px;height: 18px;">
259
260
  '.i18n('You can see a memory dump and the source code because '.
260
261
         '<strong>show_debug</strong> is activated in the configuration.').'
261
262
</div>';
262
263

                                        

 

Old New Code
139
139
                            'm' => '-',
140
140
                            'd' => '-'));
141
141

                                        
142
 
        $cmd = 'GIT_DIR='.$this->git.' git log -n 1 -- '.mb_substr($path, 1);
 
142
        $cmd = 'GIT_DIR='.$this->git.' git log -n 1 -- '.escapeshellarg(mb_substr($path, 1));
 
143

                                    
143
144
        $output = self::cmdlaunch($cmd);
144
145

                                        
145
146
        $lines = explode("\n", $output);
181
182
    public function getLog($path, $rev=FALSE)
182
183
    {
183
184
        $path = mb_substr($path, 1);
184
 
        $path = ((empty($path)) ? '' : '-- '.$path);
 
185
        $path = ((empty($path)) ? '' : '-- '.escapeshellarg($path));
185
186

                                        
186
187
        $cmd = 'GIT_DIR='.$this->git.' git log --format="%n%h %at %aN <%aE>%n%B" '.$path;
187
188
        $output = self::cmdlaunch($cmd);
242
243
     */
243
244
    public function listDirectory($path, $rev=FALSE)
244
245
    {
245
 
        $path = str_replace(' ', '\ ', $path);
246
 
 
247
246
        $folders_sort = array();
248
247
        $files_sort = array();
249
248
        $content = array();
250
 
 
 
249

                                    
251
250
        $manifest = self::getManifest($rev);
252
 
 
 
251

                                    
253
252
        $exp = explode('/', $path);
254
253
        array_shift($exp);
255
254
        $base =& $manifest['/'];
264
263
                else
265
264
                    $base =& $base[$item];
266
265
            }
267
 
 
 
266

                                    
268
267
        foreach ($base as $key => $value)
269
268
        {
270
269
            if (!is_array($value))
271
270

                                        

 

Old New Code
87
87
     */
88
88
    public function getInfos($path, $rev=FALSE)
89
89
    {
90
 
        $p = $this->svn.$path;
 
90
        $p = escapeshellarg($this->svn.$path);
91
91

                                        
92
92
        if ($rev)
93
93
            $xml = self::cmdlaunch('svn info --xml -r '.$rev.' '.$p.'@'.$rev);
138
138
     */
139
139
    public function getLog($path, $rev=FALSE)
140
140
    {
141
 
        $p = $this->svn.$path;
 
141
        $p = escapeshellarg($this->svn.$path);
142
142

                                        
143
143
        if ($rev)
144
144
            $xml = self::cmdlaunch('svn log --xml -r '.$rev.' '.$p.'@'.$rev);
178
178
     */
179
179
    public function listDirectory($path, $rev=FALSE)
180
180
    {
181
 
        $p = $this->svn.$path;
 
181
        $p = escapeshellarg($this->svn.$path);
182
182

                                        
183
183
        if ($rev)
184
184
            $xml = self::cmdlaunch('svn ls --xml -r '.$rev.' '.$p.'@'.$rev);
240
240
     */
241
241
    public function isBinary($path, $rev=FALSE)
242
242
    {
243
 
        $p = $this->svn.$path;
 
243
        $p = escapeshellarg($this->svn.$path);
244
244

                                        
245
245
        if ($rev)
246
246
            $cmd = 'svn pg svn:mime-type -r '.$rev.' '.$p.'@'.$rev;
269
269
     */
270
270
    public function getFile($path, $rev=FALSE)
271
271
    {
272
 
        $p = $this->svn.$path;
 
272
        $p = escapeshellarg($this->svn.$path);
273
273

                                        
274
274
        if ($rev)
275
275
            $cmd = 'svn cat -r '.$rev.' '.$p.'@'.$rev;
295
295
     */
296
296
    public function getDifferencesSummary($path, $prev_rev, $next_rev)
297
297
    {
298
 
        $p = $this->svn.$path;
 
298
        $p = escapeshellarg($this->svn.$path);
299
299

                                        
300
300
        $cmd = 'svn diff -r '.$prev_rev.':'.$next_rev.' '.$p.'@'.$prev_rev.
301
301
               ' --summarize --xml';
367
367
     */
368
368
    public function getRawDiff($path, $prev_rev, $next_rev)
369
369
    {
370
 
        $p = $this->svn.$path;
 
370
        $p = escapeshellarg($this->svn.$path);
371
371

                                        
372
372
        $cmd = 'svn diff -r '.$prev_rev.':'.$next_rev.' '.$p.'@'.$prev_rev;
373
373

                                        
374
374

                                        

 

Old New Code
72
72
<? if (!$is_binary): ?>
73
73
  <?=$code;?>
74
74
<? elseif ($is_binary && !isset($message)): ?>
75
 
  <img src="<?=$img;?>" alt="<?=$value;?>" />
 
75
  <img src="<?=$img;?>" alt="<?=$value;?>" style="max-width: 100%;" />
76
76
<? else: ?>
77
77
  <?=$message;?>
78
78
<? endif; ?>
79
79