~ubuntu-branches/ubuntu/trusty/phpmyadmin/trusty

« back to all changes in this revision

Viewing changes to libraries/transformations.lib.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2009-02-16 17:58:28 UTC
  • mfrom: (13.1.4 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090216175828-d2dllrukk9kecv4k
Tags: 4:3.1.2-2
* Upload to unstable.
* [INTL:es] Spanish debconf template update (Closes: #513690).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * Set of functions used with the relation and pdf feature
5
5
 *
6
 
 * @version $Id: transformations.lib.php 10211 2007-03-27 13:07:49Z cybot_tm $
 
6
 * @version $Id: transformations.lib.php 11192 2008-04-09 00:22:06Z lem9 $
7
7
 */
8
8
 
9
9
/**
131
131
}
132
132
 
133
133
/**
134
 
 * Gets the mimetypes for all rows of a table
 
134
 * Gets the mimetypes for all columns of a table
135
135
 *
136
136
 * @uses    $GLOBALS['controllink']
137
137
 * @uses    PMA_getRelationsParam()
246
246
        return false;
247
247
    }
248
248
} // end of 'PMA_setMIME()' function
249
 
 
250
 
/**
251
 
 * Returns the real filename of a configured transformation
252
 
 *
253
 
 * in fact: it just replaces old php3 with php extension
254
 
 *
255
 
 * garvin: for security, never allow to break out from transformations directory
256
 
 *
257
 
 * @uses    PMA_securePath()
258
 
 * @uses    preg_replace()
259
 
 * @uses    strlen()
260
 
 * @uses    file_exists()
261
 
 * @access  public
262
 
 * @param   string   $filename   the current filename
263
 
 * @return  string   the new filename
264
 
 */
265
 
function PMA_sanitizeTransformationFile(&$filename)
266
 
{
267
 
    $include_file = PMA_securePath($filename);
268
 
 
269
 
    // This value can also contain a 'php3' value, in which case we map this filename to our new 'php' variant
270
 
    $testfile = preg_replace('@\.inc\.php3$@', '.inc.php', $include_file);
271
 
    if ($include_file{strlen($include_file)-1} == '3'
272
 
     && file_exists('./libraries/transformations/' . $testfile)) {
273
 
        $include_file = $testfile;
274
 
        $filename     = $testfile; // Corrects the referenced variable for further actions on the filename;
275
 
    }
276
 
 
277
 
    return $include_file;
278
 
} // end of 'PMA_sanitizeTransformationFile()' function
279
249
?>