Skip to content

Commit 25bfe08

Browse files
committed
Sanitize cat_id, fixes WordPress#4691 for 2.0.x
git-svn-id: https://develop.svn.wordpress.org/branches/2.0@5841 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c5a3007 commit 25bfe08

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

wp-admin/link-import.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@
7474

7575
<h2><?php _e('Importing...') ?></h2>
7676
<?php
77-
$cat_id = $_POST['cat_id'];
78-
if (($cat_id == '') || ($cat_id == 0)) {
79-
$cat_id = 1;
80-
}
77+
$cat_id = abs( (int) $_POST['cat_id'] );
78+
if ( $cat_id < 1 )
79+
$cat_id = 1;
8180

8281
$opml_url = $_POST['opml_url'];
8382
if (isset($opml_url) && $opml_url != '' && $opml_url != 'http://') {

0 commit comments

Comments
 (0)